# CVE-2026-31239: mamba-ssm RCE (Critical 9.8)

🐍

🐍 PyPI

Not in CISA KEV

CRITICAL severity

# CVE-2026-31239 — mamba-ssm

CRITICAL 

CVE-2026-31239 is a critical-severity (CVSS 9.8) Deserialization of Untrusted Data vulnerability in mamba-ssm. The records list no fixed version yet; check the vendor advisory below and apply the mitigations in the meantime.

mamba language model framework vulnerable to insecure deserialization when loading pre-trained models from HuggingFace Hub

Also known asPYSEC-2026-406

Published

May 12, 2026

Updated

Jun 29, 2026

Affected

1 pkg

Patched

None yet

Exploits

None indexed

Exploitation data as of Nov 6, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

## EPSS Exploitation Probability

[via FIRST.org ↗](https://www.first.org/epss/)

0.4%probability of exploitation in next 30 days

Lower Risk0.00%

Lower risk than most CVEs35th percentile — riskier than 35% of all scored CVEsHighest risk

0.00%0.37%0.73%1.10%0.1%0.4%Jun 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from [FIRST.org EPSS](https://www.first.org/epss/).

## How urgent is this, really

## Where this sits among everything scored

## Real-World Exposure

1 pkg affected

🐍`mamba-ssm`

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

## Description

The mamba language model framework thru 2.2.6 is vulnerable to insecure deserialization (CWE-502) when loading pre-trained models from HuggingFace Hub. The MambaLMHeadModel.from\_pretrained() method uses torch.load() to load the pytorch\_model.bin weight file without enabling the security-restrictive weights\_only=True parameter. This allows the deserialization of arbitrary Python objects via the pickle module. An attacker can exploit this by publishing a malicious model repository on HuggingFace Hub. When a victim loads a model from this repository, arbitrary code is executed on the victim's system in the context of the mamba process.

## Affected Packages

1 total

Ecosystem

Package

Vulnerable range

Fix

🐍PyPI

`mamba-ssm` 

all versions

No fix

## Detection & mitigation playbook

Open-source dependency

1.  ### Detect
    
    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mamba-ssm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
    
2.  ### Remediation status
    
    The records we use list no patched version of mamba-ssm for CVE-2026-31239. Check the maintainer's advisory, and where your build allows, override or pin the dependency away from the vulnerable range.
    
3.  ### Mitigate without a patch
    
    Do not deserialise data from untrusted sources: where the format allows it, restrict deserialisation to an explicit allowlist of expected types, and prefer a data-only format (JSON, Protobuf) over one that can reconstruct arbitrary objects until you can upgrade.
    

## Frequently Asked Questions

The mamba language model framework thru 2.2.6 is vulnerable to insecure deserialization (CWE-502) when loading pre-trained models from HuggingFace Hub. The MambaLMHeadModel.from\_pretrained() method uses torch.load() to load the pytorch\_model.bin weight file without enabling the security-restrictive weights\_only=True parameter. This allows the deserialization of arbitrary Python objects via the pickle module. An attacker can exploit this by publishing a malicious model repository on HuggingFace Hub. When a victim loads a model from this repository, arbitrary code is executed on the victim's sys

O3 Security · Impact-Aware SCA

### Is CVE-2026-31239 in your dependencies?

Find it across PyPI, including transitive dependencies.

[Scan my dependencies](/book-demo) [How O3 SCA works](/impact-aware-sca)