CVE-2024-11393: Deserialization of Untrusted Data in Hugging Face Transformers
CVE-2024-11393 is a deserialization flaw in how Hugging Face Transformers parses MaskFormer model files. A crafted model file can run attacker code as the user who loads it. It affects transformers before 4.48.0. The fix in that release removes model conversion scripts from release wheels.
Published Nov 23, 2024 · Updated Aug 21, 2026 · Analysis Nov 1, 2026
What an attacker can do
The advisory places the flaw in the parsing of MaskFormer model files. Input is not validated, so untrusted data is deserialized. Python deserialization of attacker-controlled bytes can execute code, and here it does so with the rights of the current user.
The attacker must get a malicious model file or page in front of the victim. That makes user interaction necessary. Unlike the sibling MobileViTV2 entry, the CVSS 3.0 vector rates attack complexity as low, which gives the higher score of 8.8.
The realistic path is a poisoned MaskFormer checkpoint shared through a model hub, a ticket attachment or a team drive. Whoever loads it on a workstation, GPU server or CI job gives the attacker that account's tokens, SSH keys and datasets. The linked pull request says the conversion scripts open pickle and old Torch .bin checkpoints, and calls a serious attack unlikely. It does not name the exact vulnerable function.
Who is affected
transformers from any earlier release up to but not including 4.48.0. You are most exposed if you load MaskFormer weights or run the model conversion scripts on files from outside sources. Check your version:
pip show transformerstransformers
- Ecosystem
- PyPI
- Affected
- >= 0, < 4.48.0
- Fixed in
- 4.48.0
- Check
pip show transformers
How to fix it
Upgrade to transformers 4.48.0:
pip install --upgrade "transformers>=4.48.0"The linked pull request 35296 makes release.py delete model conversion scripts when wheels are built, because they open insecure formats such as pickle. No further workaround appears in the sources read. Until you upgrade, only load model files from sources you trust.
How to tell if you were hit
List the MaskFormer checkpoints loaded on your machines and where each came from. Look for unexpected child processes, network connections or new files written by Python processes right after a model load. Check shell history and CI logs for runs of conversion scripts on downloaded files.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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.
Questions
- How is CVE-2024-11393 different from CVE-2024-11392?
It concerns MaskFormer model file parsing instead of MobileViTV2 configuration handling. Its CVSS 3.0 vector rates attack complexity as low, so the score is 8.8 against 7.5.
- Do I need to run a server for this to matter?
No. It is a client-side risk. Any process that loads an untrusted MaskFormer file can run attacker code.
- What is the patched version?
transformers 4.48.0, per the package data. The linked pull request removes conversion scripts from release wheels.
References
Read for this analysis:
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Transformers vulnerabilities
All Transformers entriesCVE-2026-80047
Hugging Face Transformers downloads custom generation code before trust consent
high7.8No fixSep 1, 2026CVE-2026-9856
Transformers save_pretrained path traversal allows arbitrary file writes through chat template names
high7.1Aug 2, 2026CVE-2026-5241
huggingface/transformers: Arbitrary Code Execution During Model Initialization in the LightGlue Model Loading Path
high8.0Jun 3, 2026CVE-2026-4372
HuggingFace transformers vulnerable to remote code execution
high7.8May 26, 2026CVE-2026-1839
HuggingFace Transformers allows for arbitrary code execution in the `Trainer` class
medium6.5Apr 7, 2026CVE-2025-6921
Hugging Face Transformers vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer
medium5.3Sep 23, 2025
