CVE-2024-11393: Hugging Face Transformers Deserialization Vulnerability Leading to Remote Code Execution
Summary
CVE-2024-11393: Deserialization of Untrusted Data in Hugging Face Transformers. Affects transformers versions < 4.48.0. Fixed in 4.48.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Hugging Face Transformers is a widely-used library for natural language processing tasks, providing pre-trained models and tools for various applications. It supports a range of model architectures and is designed to be user-friendly, enabling developers to integrate advanced AI capabilities into their applications. However, the library has a critical vulnerability related to the deserialization of untrusted data, which can lead to severe security risks if exploited.
Vulnerability Detail
The vulnerability arises from improper validation of user-supplied data during the parsing of model files in the Hugging Face Transformers library. This flaw allows remote attackers to execute arbitrary code on affected installations by tricking users into visiting a malicious page or opening a compromised file. The lack of safeguards against deserialization of untrusted data means that an attacker can leverage this vulnerability to run code in the context of the current user, potentially leading to data breaches or system compromise.
How To Fix
Latest published version: 5.20.2 as of 22 Oct 2026
pip install --upgrade "transformers==5.20.2"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
4.48.0
This is the first release that contains the fix.
pip install --upgrade "transformers==4.48.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users should avoid opening model files from untrusted sources and refrain from visiting suspicious links that may exploit this vulnerability until the package is updated.
Conclusion
The CVE-2024-11393 vulnerability in the Hugging Face Transformers library poses a significant risk due to its potential for remote code execution. Users are strongly advised to update to the latest version to mitigate this risk and to exercise caution when handling model files from untrusted sources.
See every vulnerability recorded for transformers →
FAQ
CVE-2024-11393 is a vulnerability in the Hugging Face Transformers library that allows remote code execution due to deserialization of untrusted data.
You can check if your application is affected by using the Vulert playground at Vulert Scanner, which monitors vulnerabilities in real-time without requiring any installation.
If you cannot update the package right away, avoid using model files from untrusted sources and do not click on suspicious links until you can apply the update.
Exploitation of this vulnerability can lead to arbitrary code execution, allowing attackers to compromise systems, steal data, or perform unauthorized actions.
The CVSS score of this vulnerability is 8.8, indicating a high severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for transformers.