CVE-2026-31239
CRITICAL 9.8CVSS 3.1mamba language model framework vulnerable to insecure deserialization when loading pre-trained models from HuggingFace Hub
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.
- Published
- 12 May 2026
- Last modified
- 16 Nov 2026
- Assigned by
- cve@mitre.org
- NVD status
- Deferred
- Weakness
- CWE-502
- Also known as
- GHSA-pq2f-x424-6fjmPYSEC-2026-406
- Sources
- NVDJSONOSV GHSA-pq2f-x424-6fjmJSONOSV PYSEC-2026-406JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | PyPI | mamba-ssm | <= 2.2.6 |
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 · WEB, PACKAGE
- https://github.com/advisories/GHSA-pq2f-x424-6fjm · ADVISORY
History
- 25 Nov 2026 21:02 UTC · NVD: first stored (published 12 May 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 29 Jun 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 12 May 2026)