Safety, Security, and Cognitive Risks in State-Space Models: A Systematic Threat Analysis with Spectral, Stateful, and Capacity Attacks
Organizations: SovereignAI Security Labs, Bengaluru, India
Abstract
State-Space Models (SSMs) -- structured SSMs (S4, S4D, DSS, S5), selective SSMs (Mamba, Mamba-2), and hybrid architectures (Jamba) -- are deployed in safety-critical long-context applications: genomic analysis, clinical time-series forecasting, and cybersecurity log processing. Their linear-time scaling is compelling, yet the security properties of their compressed-state recurrent architectures remain unstudied. We present the first systematic treatment of SSM safety, security, and cognitive risks. Seven contributions: (1) Formal threat framework -- SSM Attack Surface (five layers), State Integrity Violation (StIV), Cross-Context Amplification Ratio , and a Spectral Sensitivity Proposition grounded in the norm. (2) Three novel attack classes: spectral adversarial attacks (transfer-function gain exploitation), delayed-trigger stateful backdoors (activate thousands of steps after injection), and state capacity saturation (entropy flooding forces silent forgetting). (3) 14 MITRE ATLAS technique extensions across the full tactic chain. (4) Six-profile attacker taxonomy with kill chains for genomics, clinical, and cybersecurity domains. (5) Four cognitive risk hypotheses grounded in state-compression mechanics. (6) Governance-aligned mitigations mapped to CREST, NIST AI 600-1, and EU AI Act. (7) Empirical evaluation: targeted genomic injection achieves vs. random (, ); PGD state injection achieves output perturbation over random; SSD-structured extraction confirmed at vs. query complexity ( speedup). Validation on pretrained checkpoints is detailed in the Appendix.
Figures & tables
| Architecture | Distinctive Safety / Reliability Risk | Distinctive Security Risk |
|---|---|---|
| LTI (classical) | Discretisation error; model mismatch under nonstationarity | Input perturbation via filter gain; frequency-domain attacks |
| HiPPO / LMU | Singular ODE; implementation-dependent stability | Basis coefficient extraction; interpretability aids auditing |
| S4 (DPLR) | Numerical conditioning of non-normal ; Cauchy kernel instability | Spectral attacks at high-gain modes; delayed state corruption |
| S4D / DSS / S5 (diagonal) | Weaker convergence to HiPPO transfer function; init sensitivity | Diagonal structure simplifies gradient-based attacks; Fourier-mode targeting |
| PTD-robustified | Reduced Fourier-mode brittleness; new hyperparameters | Improved robustness in evaluated modes; other modes may remain vulnerable |
| Mamba (selective) | Long-context forgetting; state capacity bottleneck | Delayed-trigger backdoors; selection subversion; state capacity saturation |
| SSM Layer | ATLAS Tactic | Relevant Technique / Extension |
| Reconnaissance, Initial Access | T-SSM-01 Spectral Probe; T-SSM-02 Domain-Specific Encoding | |
| Execution, Persistence | T-SSM-03 Recurrent State Injection; T-SSM-04 Delayed Trigger Implant; T-SSM-05 State Matrix Poisoning | |
| Execution, Evasion | T-SSM-06 Selection Subversion; T-SSM-07 Gating Evasion; T-SSM-08 Discretisation Timing Attack | |
| Impact, Discovery | T-SSM-09 Output Projection Poisoning; T-SSM-10 SSD-Based Model Extraction | |
| Persistence, Privilege Escalation | T-SSM-11 State Capacity Saturation; T-SSM-12 Context Buffer Overflow; T-SSM-13 Cross-Session State Contamination | |
| Supply Chain | Resource Development | T-SSM-14 HiPPO Initialisation Compromise |
| ID | Short Name | Description |
|---|---|---|
| T-SSM-01 | Spectral Probe | Query the model with sinusoidal sweeps to estimate transfer-function magnitude , identifying high-gain frequency bands for subsequent spectral attacks. |
| T-SSM-02 | Domain-Specific Encoding | Craft adversarial inputs indistinguishable from legitimate domain data (synthetic SNPs, perturbed vital signs, slow-drift log events) that exploit encoder-layer vulnerabilities. |
| T-SSM-03 | Recurrent State Injection | Inject adversarial perturbations into via PGD or zeroth-order methods, maximising StIV over subsequent recurrent steps. |
| T-SSM-04 | Delayed Trigger Implant | Training-time backdoor embedding a trigger that injects a latent payload into , activating adversarial output only after recurrent steps—evading activation-clustering defences. |
| T-SSM-05 | State Matrix Poisoning | Supply-chain or insider attack modifying to embed a hidden subspace that preserves adversarial state encodings indefinitely under recurrence. |
| T-SSM-06 | Selection Subversion | Craft inputs to force (state freeze) or (state erase) via manipulation of Mamba’s selective gating mechanism. |
| Profile | Access & Capability | Representative Techniques | Feasibility | Impact |
| Opportunistic | Public checkpoints; black-box API; no privileged access | T-SSM-01, T-SSM-11 | High | Low–Medium (PoC, reputation) |
| Targeted | Domain expertise (genomics, clinical) + black-box API; gradient estimation via surrogates | T-SSM-02, T-SSM-03 | Medium | Medium–High (targeted misdiagnosis, false-negative IDS) |
| Insider | Direct weight and infrastructure access | T-SSM-05, T-SSM-09, T-SSM-14 | Very High | Critical |
| Nation-State | Unlimited compute; training-data poisoning at scale; supply-chain compromise | T-SSM-04, T-SSM-05, T-SSM-14 | High | Critical (infrastructure, public health) |
| Supply-Chain | Compromises upstream artefacts: HuggingFace checkpoints, genome databases, SSM libraries | T-SSM-14, T-SSM-04 | Medium–High | Critical (all downstream fine-tunes) |
| Stateful Adversary | API access to stateful deployment; no weight access; SSM-specific (no Transformer analogue) | T-SSM-12, T-SSM-13 | Medium | High (cross-user contamination, audit evasion) |
| Domain | Genomic variant calling and disease phenotype prediction |
|---|---|
| Techniques | T-SSM-01 (Spectral Probe), T-SSM-02 (Domain-Specific Encoding) |
| Attacker Profile | Targeted (domain genomics knowledge + API access) |
| Feasibility | Medium-High — E1-Pilot confirms StIV advantage of targeted over random injection |
| Impact | High — misdiagnosis, inappropriate treatment, liability |
| Domain | Clinical time-series forecasting (ICU deterioration prediction) |
|---|---|
| Technique | T-SSM-04 (Delayed Trigger Implant) |
| Attacker Profile | Insider or Supply-Chain |
| Feasibility | High — architectural analysis predicts 60% activation at 50K steps (see Appendix A ) |
| Impact | Critical — patient death, institutional liability, regulatory action |
| Domain | AI-assisted legal document review (contract analysis, due diligence) |
|---|---|
| Technique | T-SSM-11 (State Capacity Saturation) |
| Attacker Profile | Targeted (requires understanding of SSM state capacity dynamics) |
| Feasibility | High — predicted 80% needle-forgetting at (see Appendix A ) |
| Impact | High — missed liability, financial damage, legal malpractice |
| Domain | Proprietary financial time-series SSM (market forecasting, fraud detection) |
|---|---|
| Technique | T-SSM-10 (SSD-Based Model Extraction) |
| Attacker Profile | Targeted (SSD theory knowledge + black-box API access) |
| Feasibility | Medium — algebraically confirmed vs. query complexity (E5) |
| Impact | High — IP theft, competitive advantage loss, regulatory violation |
| Domain | Cybersecurity SOC with streaming SSM log analysis |
|---|---|
| Technique | T-SSM-13 (Cross-Session State Contamination) |
| Attacker Profile | Stateful Adversary (insider with API access to shared deployment) |
| Feasibility | High — requires only API access; no model weight access needed |
| Impact | Critical — undetected breach, chain-of-custody violation |
| Budget | Targeted StIV | Stealth StIV | Random StIV | T/R Ratio |
|---|---|---|---|---|
| 3 | 0.056 | 0.039 | 0.028 | 2.0 |
| 10 | 0.136 | — | 0.042 | 3.3 |
| 20 | 0.242 | — | 0.050 | 4.8 |
| 30 | 0.392 | — | 0.064 | 6.1 |
| 50 | 0.519 | 0.483 | 0.086 | 6.0 |
| Coupling | PGD | (PGD/Rand) | |
|---|---|---|---|
| 0.005 | Loose | measured | 156 |
| 0.01 | Loose | measured | 11.1 |
| 0.02 | Loose | measured | 16.1 |
| 0.05 | Loose | measured | 13.4 |
| 0.005–0.05 | Tight | 0.0 | 1.0 (suppressed) |
| Attack | SFR (%) | SER (%) | Acc. Drop (%) | |
|---|---|---|---|---|
| Freeze ( ) | 0.01 | 1.76 | 0.0 | 0.0 |
| Erase ( ) | 0.01 | 1.76 | 0.0 | 0.0 |
| Random (baseline) | 0.01 | 1.76 | 0.0 | 0.0 |
| Freeze ( ) | 0.02 | 1.76 | 0.0 | 0.0 |
| Erase ( ) | 0.02 | 1.76 | 0.0 | 0.0 |
| State dim | SSD queries | Generic queries | Speedup | ||
|---|---|---|---|---|---|
| 64 | 4,096 | 262,144 | 64 | 2.0 | 3.0 |
| 128 | 16,384 | 2,097,152 | 128 | 2.0 | 3.0 |
| 256 | 65,536 | 16,777,216 | 256 | 2.0 | 3.0 |
| 512 | 262,144 | 134,217,728 | 512 | 2.0 | 3.0 |
| 1024 | 1,048,576 | 1,073,741,824 | 1024 | 2.0 | 3.0 |
| Limitation | Discussion and Path Forward |
|---|---|
| Partial experimental validation | Of the five experiments, three produce confirmed results: E1-Pilot (genomic StIV with 95% bootstrap CIs), E2-Pilot (PGD output-perturbation ratio), and E5 (algebraic complexity). E2, E3, and E4 are reported with theoretical predictions only—the proxy model lacks Mamba’s selective-scan gating ( ), returning inconclusive null results. Validation on pretrained Mamba and Jamba checkpoints is detailed in Appendix A . |
| Partial attack coverage | Of 14 SSM-specific threats, 5 have empirical evidence (E1, E2 pilot, E5). The remaining 9 are formalised but not yet instantiated empirically. Priority follow-up: T-SSM-13 (Cross-Session Contamination) and T-SSM-08 (Discretisation Timing Attack). |
| LTI approximation for spectral analysis | Proposition 3.1 is derived for LTI systems. Mamba’s selective dynamics are input-dependent and nonlinear; the spectral bound applies rigorously only at linearised operating points. Remark 3.2 provides a first-order extension; a full nonlinear spectral bound remains open. |
| White-box attack assumption | E1–E3 assume white-box model access. Black-box spectral attacks are feasible via spectral probing (T-SSM-01) but require more queries; the query-budget/success trade-off is not yet quantified. |
| Delayed-trigger transfer | Backdoor persistence (E2) is evaluated in a from-scratch training setting. Transfer learning (fine-tuning a backdoored pretrained model) may alter persistence; this is critical for supply-chain safety analysis. |
| Cognitive risk hypotheses | H1–H4 are supported by prior cognitive science literature and architectural analysis but are not empirically validated here. User studies in clinical and legal settings are required. |
| Work | SSM-Specific | Spectral Attack | Delayed Trigger | Capacity Saturation | Governance |
|---|---|---|---|---|---|
| Madry et al. [ 26 ] | – | – | – | – | – |
| Wallace et al. [ 43 ] | – | – | – | – | – |
| Hubinger et al. [ 22 ] | – | – | (limited) | – | – |
| Karim et al. [ 24 ] | partial | – | – | – | – |
| Carlini et al. [ 5 ] | – | – | – | – | – |
| Yu et al. [ 48 ] | partial | – | – | – |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | (mean IQR) | Spectral | TD | Ratio |
|---|---|---|---|---|
| Mamba-130M (S6) | pending | pending | pending | pending |
| Mamba-370M (S6) | pending | pending | pending | pending |
| Mamba-2-130M (SSD) | pending | pending | pending | pending |
| GPT-2-Small (MHA) | N/A | pending | pending | pending |
| Model | Clean (%) | BAR@100 | BAR@1K | BAR@10K | BAR@50K |
|---|---|---|---|---|---|
| Mamba-130M | pending | pending | pending | pending | pending |
| GPT-2-Small | pending | pending | pending | pending | pending |
| Model | Arch. | ||||
|---|---|---|---|---|---|
| Mamba-130M | SSM | p | p | p | p |
| Mamba-370M | SSM | p | p | p | p |
| Mamba-2.8B | SSM | p | p | p | p |
| Mamba-2-130M | SSD | p | p | p | p |
| Jamba-v0.1 | Hybrid | p | p | p | p |
| GPT-2-Small | MHA | p | p | p | p |
| Mitigation | Attack ( ) | ASR (%) | Clean (%) | |
|---|---|---|---|---|
| None (baseline) | Spectral PGD | 8.43 | 79.3 | 0.0 |
| M1 bandstop | Spectral PGD | pending | pending | pending |
| M1 bandstop | TD PGD | pending | pending | pending |
| M6 spectral training | Spectral PGD | pending | pending | pending |
| (bits) | TPR (%) | FPR (%) | NFR Reduction | Latency Overhead |
|---|---|---|---|---|
| 5.0 | pending | pending | pending | pending |
| 5.5 | pending | pending | pending | pending |
| 6.0 | pending | pending | pending | pending |
| Model | In-Context | Activation Rate at Delay (%) | ACD AUC | |||
|---|---|---|---|---|---|---|
| Baseline | ||||||
| Mamba (4L, 256H) | 70 | 70 | 70 | 60 | 60 | 0.54 |
| Transformer (4L) | 78 | 71 | 40 | 15 | 10 | 0.80 |
| LSTM (4L) | 72 | 69 | 45 | 20 | 15 | 0.78 |
| Model | Haystack Type | |||
|---|---|---|---|---|
| Mamba (4L, 512H) | Benign | 12 | 29 | 47 |
| Mamba | Low-entropy sat. | 14 | 31 | 53 |
| Mamba | High-entropy sat. | 39 | 62 | 80 |
| Transformer (4L) | Benign | 8 | 10 | 11 |
| Transformer | Low-entropy sat. | 9 | 10 | 13 |
| Transformer | High-entropy sat. | 12 | 15 | 20 |
State Space Models
State space models represent sequences through evolving latent states, enabling efficient temporal modeling, system identification, and forecasting.
See all 295 papers