The vulnerability exists in the mamba-ssm package, specifically in how it loads pre-trained models. The MambaLMHeadModel.from_pretrained method, which is used to load these models, internally calls the load_state_dict_hf function. This function uses torch.load to deserialize the model file but fails to set the weights_only=True parameter. This omission allows an attacker to create a malicious model file containing arbitrary code. When a user loads this malicious model, the code is executed on their system, leading to a remote code execution vulnerability. The analysis of the source code of the vulnerable version confirms this flaw. No patch is available in the analyzed version, and the recommended mitigation is to manually enable the weights_only=True parameter or use a safer model loading method.