# CVE-2026-31239: mamba language model framework vulnerable to insecure deserialization when loading pre-trained models from HuggingFace Hub

- Severity: Critical 9.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.41%, higher than 37% of CVEs (2026-12-01)
- Published: 2026-05-12T00:00:00.000Z
- Modified: 2026-11-16T15:30:04.640Z
- Also known as: GHSA-pq2f-x424-6fjm, PYSEC-2026-406
- Weaknesses: CWE-502
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: mitre

## 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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- mamba-ssm (PyPI): up to 2.2.6

## Every score

- CISA-ADP: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/state-spaces/mamba> (package)
- <https://www.notion.so/CVE-2026-31239-35d1e1393188810d9baedfbd8363f396> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-31239> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/mamba-ssm/PYSEC-2026-406.yaml> (web)
- <https://pypi.org/project/mamba-ssm> (package, web)
- <https://github.com/advisories/GHSA-pq2f-x424-6fjm> (advisory)

## Sources

- CVE List: [CVE-2026-31239](https://www.cve.org/CVERecord?id=CVE-2026-31239), CVE Terms of Use, modified 2026-05-14
- GitHub Advisory Database: [GHSA-pq2f-x424-6fjm](https://github.com/advisories/GHSA-pq2f-x424-6fjm), CC-BY-4.0, modified 2026-11-16
- NVD: [CVE-2026-31239](https://nvd.nist.gov/vuln/detail/CVE-2026-31239), Public domain, modified 2026-10-19
- PyPA Advisory Database: [PYSEC-2026-406](https://osv.dev/vulnerability/PYSEC-2026-406), CC-BY-4.0, modified 2026-07-01

---

Page: https://cve.day/CVE-2026-31239 · Whole record: https://cve.day/CVE-2026-31239.json · Rebuilt by cve.day 2026-11-25T22:59:21.389Z
