CVE-2024-11393: Deserialization of Untrusted Data in Hugging Face Transformers
Hugging Face Transformers MaskFormer Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Hugging Face Transformers.
What it is
Hugging Face Transformers MaskFormer Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Hugging Face Transformers. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.
The specific flaw exists within the parsing of model files. The issue results from the lack of proper validation of user-supplied data, which can result in deserialization of untrusted data. An attacker can leverage this vulnerability to execute code in the context of the current user. Was ZDI-CAN-25191.
How to check
- Affected: transformers (pip) >= 0, < 4.48.0.
- Compare your installed version with the range above (command below).
How to fix
- Upgrade transformers to 4.48.0 or later.
pip show transformers | grep Version Sources
- criticalMalicious PyPI packages qwen-tts-cpu and qwen-tts-runtime pose as Qwen text-to-speech add-ons and download and run remote code
- criticalCVE-2023-6730: transformers has a Deserialization of Untrusted Data vulnerability
- highCVE-2026-139989: The languagemodels Python package rendered Hugging Face chat templates in an unsandboxed Jinja2 environment, so a malicious model repo could run commands
- highCVE-2026-57845: Loading a dataset with Hugging Face Datasets' pandas builder can run attacker code