CVE-2026-31239
JSON

9.8critical

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

Severity
9.8critical CVSS:3.1 by CISA-ADP
Exploit likelihood
0.41% (higher than 37% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-pq2f-x424-6fjmPYSEC-2026-406

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

Product or packageVersionsReported by
Unspecified productn/aCVE List
mamba-ssm (PyPI)up to 2.2.6GitHub Advisory Database, PyPA Advisory Database

All scores

CISA-ADP9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
PyPA Advisory Database9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-502

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

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.

NVD (es)

El framework del modelo de lenguaje mamba hasta la versión 2.2.6 es vulnerable a deserialización insegura (CWE-502) al cargar modelos preentrenados desde HuggingFace Hub. El método MambaLMHeadModel.from_pretrained() utiliza torch.load() para cargar el archivo de pesos pytorch_model.bin sin habilitar el parámetro restrictivo de seguridad weights_only=True. Esto permite la deserialización de objetos Python arbitrarios a través del módulo pickle. Un atacante puede explotar esto publicando un repositorio de modelos malicioso en HuggingFace Hub. Cuando una víctima carga un modelo desde este repositorio, se ejecuta código arbitrario en el sistema de la víctima en el contexto del proceso mamba.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-31239 changed 2026-05-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-pq2f-x424-6fjm changed 2026-11-16CC-BY-4.0
NVDCVE-2026-31239 changed 2026-10-19Public domain
PyPA Advisory DatabasePYSEC-2026-406 changed 2026-07-01CC-BY-4.0