---
title: "CVE-2026-31239: mamba language model framework vulnerable to insecure deserialization when loading pre-trained models from HuggingFace Hub"
url: https://erroneo.us/security/cve/CVE-2026-31239/
description: "CVE-2026-31239 (mamba-ssm (PyPI)): The mamba language model framework thru 2.2.6 is vulnerable to insecure deserialization (CWE-502) when loading…"
type: vulnerability-record
section: "Security Digest"
date_published: 2026-05-12
date_modified: 2026-05-27
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2026-31239"
kev: false
cvss: 9.8
epss: 0.00597
license: All rights reserved. Quote with attribution and a link.
---

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

**Signal:** Critical and remotely reachable. No known exploitation yet, but it is network-reachable without credentials. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.6% , percentile 48: FIRST’s model estimates a 0.6% chance of exploitation activity in the next 30 days, higher than 48% of all scored CVEs (low). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes mamba-ssm (PyPI) <= 2.2.6, no fixed version listed . Check your lockfile, including transitive dependencies.

## What it is

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.frompretrained() method uses torch.load() to load the pytorchmodel.bin weight file without enabling the security-restrictive weightsonly=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

- PyPI `mamba-ssm` <= 2.2.6 → fixed: none listed

## Affected products (CVE record)

- n/a n/a: see advisory

## Severity

- CISA-ADP CVSS 3.1: 9.8 `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 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable yes , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.60% probability of exploitation activity in the next 30 days; percentile 48.

## Sources

- [GitHub Advisory GHSA-pq2f-x424-6fjm](https://github.com/advisories/GHSA-pq2f-x424-6fjm)
- [CVE.org record CVE-2026-31239](https://www.cve.org/CVERecord?id=CVE-2026-31239)
- [NVD entry CVE-2026-31239](https://nvd.nist.gov/vuln/detail/CVE-2026-31239)
- [github.com](https://github.com/state-spaces/mamba)
- [notion.so](https://www.notion.so/CVE-2026-31239-35d1e1393188810d9baedfbd8363f396)

---
Source page: https://erroneo.us/security/cve/CVE-2026-31239/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
