CVE-2026-31239 Details
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.
A vulnerability allowing insecure deserialization has been identified in the Mamba language model framework, versions through 2.2.6. This issue arises when the framework loads pre-trained models from Hugging Face Hub. The vulnerability is rooted in the MambaLMHeadModel.from_pretrained() method, which utilizes torch.load() to import the pytorch_model.bin weight file without activating the security-focused weights_only=True parameter. As a result, arbitrary Python objects can be deserialized using the pickle module. An attacker could exploit this vulnerability by uploading a malicious model repository to Hugging Face Hub. When a user loads a model from this repository, it triggers the execution of arbitrary code on the user's system within the Mamba process.
Users can avoid this vulnerability by not loading models from untrusted repositories on Hugging Face Hub. If using Mamba version 2.2.6 or earlier, consider updating to a version where this vulnerability is addressed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed May 12, 2026CISA-ADP
Assessed May 14, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/state-spaces/mamba | [email protected] | Source CodeVendor |
| https://www.notion.so/CVE-2026-31239-35d1e1393188810d9baedfbd8363f396 | [email protected] | Not Applicable |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-502 | Deserialization of Untrusted Data | CISA-ADP |
Affected Products
| Product | Versions |
|---|---|
| state-spaces/mamba | All versions |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 19, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 14, 2026 | CVE Modified | CISA-ADP |
| May 12, 2026 | New CVE Received | [email protected] |
Volerion