Skip to content
DayZeroHub
Critical CVSS 9.8GHSA-pq2f-x424-6fjmCVE-2026-31239

mamba-ssm: insecure deserialization when loading pre-trained models from HuggingFace Hub

mamba-ssm

Summary

The mamba language model framework (mamba-ssm package, up to version 2.2.6) is vulnerable to insecure deserialization (CWE-502) when loading models from HuggingFace Hub. The source rates it critical severity with a CVSS score of 9.8.

What happened

The MambaLMHeadModel.from_pretrained() method uses torch.load() to load the pytorch_model.bin weight file without enabling the restrictive weights_only=True parameter. This allows arbitrary Python objects to be deserialized through the pickle module. An attacker could publish a malicious model repository on HuggingFace Hub; if a victim loads a model from that repository, arbitrary code would be executed on their system in the context of the mamba process. Identifiers: CVE-2026-31239 and GHSA-pq2f-x424-6fjm.

Why it matters

The source reports a CVSS 3.1 score of 9.8 (vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) and critical severity, with high impact on confidentiality, integrity and availability. According to the available information, CISA's KEV catalog does not list this vulnerability as actively exploited, and the source provides no evidence that it is a zero-day.

Affected products and versions

mamba-ssm (PyPI ecosystem): versions <= 2.2.6. The source does not state a fixed version.

ProductVersionsFixed in
mamba-ssm<= 2.2.6—

Action recommended by the source

The source does not state a fixed version or a vendor mitigation. Readers are advised to check the GitHub advisory (GHSA-pq2f-x424-6fjm) and the PyPI package page for updates.

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-502

Relevant change history

  1. Published

    Advisory published.

Summary written with AI assistance from the source data. See the sources and references for complete information. View sources