Mamba Language Model Framework Insecure Deserialization Vulnerability Allowing Arbitrary Code Execution

Vulnerability

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.

Impact

Exploitation of this vulnerability leads to arbitrary code execution on the victim's system, executed in the context of the Mamba process.

Reproduction

To reproduce this vulnerability, load a model from a malicious repository on Hugging Face Hub into the Mamba language model framework, versions through 2.2.6. The MambaLMHeadModel.from_pretrained() method will deserialize the model weights without the necessary security precautions, allowing any embedded code to execute on the system.

Remediation

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.

Added: May 12, 2026, 6:27 PM
Updated: May 12, 2026, 6:27 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
7.5
exploitability
6.6
remediation
0.0
relevance
8.1
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.