Hugging Face Transformers
CVE-2025-14924
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious megatron_gpt2 checkpoint
-
DeliveryDeliver via model hub or file
-
ExploitVictim loads checkpoint in Transformers
-
ExecutionUntrusted data deserialized (CWE-502)
-
ImpactArbitrary code runs as current user
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the victim to load/parse an attacker-controlled model checkpoint for the megatron_gpt2 model using Hugging Face Transformers (confirmed affected: version 4.55.0). The specific trigger is the checkpoint-parsing code path, which deserializes user-supplied data without proper validation (CWE-502). LIMITING FACTORS: the CVSS vector is AV:L with UI:R, meaning the attack is not remotely triggerable without victim action - a user must actively open the malicious file or visit a page that causes the checkpoint to be loaded. Code executes only with the privileges of the loading process/user (PR:N reflects no pre-authentication to the app, not elevated rights gained). This confines realistic risk to workflows that ingest untrusted third-party checkpoints. |
| Impact | This is a genuine but second-tier priority. The CVSS 3.0 base score of 7.8 is driven by a LOCAL attack vector (AV:L) combined with required user interaction (UI:R) and high confidentiality, integrity, and availability impact (C:H/I:H/A:H) with no privileges required (PR:N) and low complexity (AC:L). Critically, this is NOT a remotely-triggerable network flaw despite the 'Remote Code Execution' naming - the AV:L vector means exploitation requires the victim to locally load/parse an attacker-supplied checkpoint file. The EPSS score of 0.33% (25th percentile) is low, indicating low statistical likelihood of mass exploitation in the near term, which is consistent with the fact that there is no public exploit identified and the CVE is NOT on the CISA KEV list. These signals are internally consistent: a file-borne deserialization bug requiring user interaction is a targeted/social-engineering vector rather than a wormable, internet-facing one. One nuance worth flagging: the description uses the phrase 'remote attackers' and 'visit a malicious page,' yet the CVSS vector is AV:L - this reflects the ZDI convention where opening a malicious file counts as local even if the file is delivered over the network. No SSVC decision data was provided in the input. Overall: real and dangerous for environments that ingest third-party model checkpoints, but not a drop-everything internet-facing emergency. |
| Exploit ScenarioDerived | An attacker publishes a trojanized model checkpoint on a model-sharing hub or sends it directly to a victim (e.g., a data scientist). When the victim loads the megatron_gpt2 checkpoint using Hugging Face Transformers, the embedded untrusted serialized payload is deserialized without validation (CWE-502), executing arbitrary code in the context of the user's process. No public exploit code has been identified at time of analysis, but the technique (malicious pickle/checkpoint deserialization) is well understood in the ML security community. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Arbitrary code execution in Hugging Face Transformers 4.55.0 occurs when the library parses an attacker-supplied megatron_gpt2 model checkpoint, because checkpoint data is deserialized without adequate validation (CWE-502). The attack is not remotely triggerable on its own: the CVSS vector is AV:L with UI:R, so a victim must actively open a malicious file or visit a page that causes the crafted checkpoint to be loaded, and any code then runs with the privileges of the loading process or user. This is a genuine but second-tier priority - the EPSS score is only 0.33% (25th percentile), there is no CISA KEV listing, and no public exploit was identified at time of analysis; realistic exposure is confined to workflows that ingest third-party or otherwise untrusted checkpoints. The issue was reported through Trend Micro ZDI as ZDI-CAN-27984 / ZDI-25-1141.
RemediationAI
No vendor-released patch was identified at time of analysis; the only reference supplied is the ZDI advisory (https://www.zerodayinitiative.com/advisories/ZDI-25-1141/), so confirm fixed-version guidance with Hugging Face before relying on an upgrade, and treat 4.55.0 as vulnerable until then. The most effective compensating control is to stop untrusted checkpoints from reaching the deserialization path: only load megatron_gpt2 checkpoints from sources you control and verify their hashes or signatures before use, and prefer non-executable weight formats such as safetensors where the workflow permits (trade-off: not all Megatron checkpoints are distributed in that format, and conversion itself requires a trusted environment). If untrusted third-party checkpoints must be evaluated, parse and run them inside a disposable, low-privilege container or VM with no network access, no mounted credentials, and no write access to shared storage, accepting the operational overhead this adds. Restricting or disabling the megatron_gpt2 loading code path in applications that never need Megatron checkpoints removes the exposure entirely, at the cost of losing that model-family support; blocking automatic model downloads from untrusted repositories similarly reduces the chance a user is tricked into loading a malicious file, though it does not protect against files delivered by other means.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw sits in the megatron_gpt2 model-loading path of Hugging Face Transformers, the widely used Python library that provides model architectures and checkpoint-loading utilities for the transformer ecosystem. Per the CWE-502 classification, the checkpoint-parsing code deserializes user-supplied data without validating it, a failure mode characteristic of Python serialization formats (such as pickle-based checkpoint files) in which object reconstruction can invoke arbitrary callables. Because the payload is only evaluated when a checkpoint is parsed, the attack surface is the trust boundary between the library and the model artifacts it consumes: anything that convinces a user or pipeline to load a crafted checkpoint converts the deserialization step into code execution inside the loading interpreter. CPE data confirms the affected package as cpe:2.3:a:huggingface:transformers:4.55.0; the local-vector, user-interaction-required scoring reflects that no pre-authentication to an exposed service is involved and that privilege is not escalated beyond the context of the process performing the load.
Know when Transformers gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
File-borne checkpoint deserialization requires the victim to load the malicious file (AV:L, UI:R); no prior auth needed (PR:N), and code execution yields full C/I/A impact in the user context.
Primary rating from Vendor (trendmicro).
CVSS VectorVendor: trendmicro
DescriptionCVE.org
Hugging Face Transformers megatron_gpt2 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 checkpoints. 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 process. Was ZDI-CAN-27984.
Blast Radius
ecosystem impact- 4 pypi packages depend on transformers (4 direct, 0 indirect)
Ecosystem-wide dependent count for version 4.55.0.
Executive ViewAI
Hugging Face Transformers 4.55.0 contains a high-severity arbitrary code execution flaw that triggers when a user loads a crafted megatron_gpt2 checkpoint, putting AI/ML teams that ingest third-party models at risk of local compromise under the loader's privileges. Because exploitation requires user interaction and untrusted checkpoint ingestion, exposure is concentrated in model supply-chain workflows rather than broad remote attack surfaces, but a successful compromise could affect data, credentials, and downstream AI systems.
No vendor-released patch identified at time of analysis; restrict ingestion to trusted checkpoints, prefer safe tensor formats such as safetensors, load models in sandboxed low-privilege environments with network isolation, and monitor the vendor advisory for a fixed release.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)CVE.org
More in Transformers
View allThe huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,
The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (R
A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe
Remote code execution in Hugging Face Transformers 5.2.0 allows a malicious model repository to bypass the user's explic
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp
Hugging Face Transformers Trax Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. Rated high s
NVD
CVE.org
EPSS
GitHub PoC
Exploit-DB