Hugging Face Transformers CVE-2025-14921
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious Transformer-XL model file
-
DeliveryDistribute via model hub or link
-
ExploitVictim loads model in Transformers
-
ExecutionUnsafe deserialization triggers payload
-
ImpactExecute arbitrary code 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/open an attacker-supplied Transformer-XL model file in Hugging Face Transformers; the flaw is in the parsing of model files where user-supplied data is deserialized without proper validation (CWE-502). Key limiting factors: the CVSS vector is AV:L with UI:R, meaning there is no direct network attack surface - the attacker must socially engineer the target into visiting a malicious page or opening a malicious model file. No authentication is required (PR:N), and impact is confined to the current user's context (S:U), so code runs with the victim's privileges rather than escalated. Affected version per CPE is huggingface transformers 4.54.1. |
| Impact | This is a genuine-but-conditional code-execution risk rather than a mass-exploitation emergency. The CVSS 3.0 vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, base 7.8) is notable because the 'remote attackers' framing in the description is reconciled by the LOCAL attack vector combined with required user interaction (UI:R): the victim must be convinced to load/open a malicious model file, so exploitation is user-triggered rather than a directly network-reachable server flaw. No privileges are required (PR:N) and complexity is low (AC:L), so once a victim opens a weaponized Transformer-XL model, deserialization (CWE-502) yields full C/I/A impact in that user's context. The real-world signals point AWAY from urgent widespread risk: EPSS is only 0.33% (25th percentile), the CVE is NOT on CISA KEV, and no public exploit code was provided in the input. There is no SSVC decision data in the input to assess automatable/exploitation state. Net: a credible RCE in a very popular ML library, but gated behind social engineering and low observed exploitation probability - prioritize as a patch-in-normal-cycle item for ML/data-science environments, not a drop-everything KEV-tier incident. Note the mismatch to flag: the description's 'remote attackers' wording versus the CVSS AV:L local vector - the operative model is 'attacker-supplied file opened locally,' not remote network exploitation. |
| Exploit ScenarioDerived | An attacker publishes or shares a malicious Transformer-XL model file (e.g., on a model hub, via a link, or an email attachment) crafted to trigger unsafe deserialization when parsed. A data scientist or engineer loads that model using Hugging Face Transformers, and the embedded payload executes arbitrary code in the user's context. No public exploit code was identified in the provided data, but the low attack complexity (AC:L) makes a working exploit straightforward to construct once the deserialization path is known. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Deserialization of attacker-supplied model data in Hugging Face Transformers 4.54.1 allows an attacker to execute arbitrary code with the victim's privileges when a user is convinced to load a crafted Transformer-XL model file, for example by opening a malicious file or visiting a page that triggers model loading. The flaw is a CWE-502 validation failure in the model-file parsing path, scored 7.8 under CVSS 3.1 (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H), meaning there is no direct network attack surface, user interaction is required, and execution is confined to the current user's context rather than escalated. No confirmed active exploitation (not in CISA KEV) and no public exploit identified at time of analysis; EPSS is low at 0.33% (25th percentile), consistent with a conditional, user-interaction-driven risk rather than a mass-exploitation emergency.
RemediationAI
No vendor-released patch was identified at time of analysis, so remediation is primarily exposure reduction; monitor https://www.zerodayinitiative.com/advisories/ZDI-25-1149/ and the Hugging Face Transformers release notes for an official fixed version before upgrading. In the interim, stop loading Transformer-XL checkpoints from untrusted sources and require hash or signature verification for any model artifact pulled from a hub or third-party repository. Where the model is available in safetensors format, prefer it over pickle-based checkpoint files, since safetensors does not execute code during loading; the trade-off is that some older or community repositories only publish pickle .bin weights, so conversion or re-export may be required and incomplete coverage should be expected. Load untrusted models inside a sandboxed container or VM with a low-privilege service account, read-only mounts, and no outbound network egress, which contains post-exploitation activity at the cost of GPU passthrough and pipeline complexity. Finally, treat model files as executable content in email and web-browsing policy, since exploitation depends on a user opening a malicious file or visiting a malicious page.
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 root cause is CWE-502, Deserialization of Untrusted Data, in the code path Hugging Face Transformers uses to parse model files. Model checkpoints and related artifacts are commonly serialized object graphs, and when the library reconstructs such objects from a file whose contents the attacker controls, the deserialization process can instantiate arbitrary classes and invoke attacker-chosen callables, yielding code execution under the interpreter that loaded the model. Here the specific parsing path is the Transformer-XL model implementation, and the CPE record pins the affected build to cpe:2.3:a:huggingface:transformers:4.54.1. The finding originated as ZDI-CAN-25424 and was published by Trend Micro's Zero Day Initiative as ZDI-25-1149. Because the vector is AV:L with UI:R, the weakness is not remotely reachable on its own: the attacker must first deliver a malicious model file or a page that causes one to be loaded, and any resulting code inherits the privileges of the user running the Transformers process (S:U), so the boundary crossed is the victim's account rather than the host or a privileged service.
Know when Hugging Face 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
Attack is local via an opened malicious model file (AV:L, UI:R), needs no privileges (PR:N), and unsafe deserialization yields full code execution in the user's context (C/I/A:H, S:U).
Primary rating from Vendor (trendmicro).
CVSS VectorVendor: trendmicro
DescriptionCVE.org
Hugging Face Transformers Transformer-XL 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-25424.
Blast Radius
ecosystem impact- 10 pypi packages depend on transformers (8 direct, 2 indirect)
Ecosystem-wide dependent count for version 4.54.1.
Executive ViewAI
Hugging Face Transformers 4.54.1 has a high-severity model-loading flaw in which a crafted Transformer-XL file can execute code at the privileges of the user who loads it, creating risk for developer and data-science teams that handle third-party models. The exposure is conditional on user interaction and is concentrated in workstation and model-supply-chain workflows rather than directly reachable network services. Leadership should care because no vendor-released patch is identified at time of analysis and no public exploit identified at time of analysis, so risk must be managed through trusted model provenance and isolated execution.
No vendor-released patch identified at time of analysis. Interim mitigations: restrict Transformer-XL model loading to trusted, verified sources; avoid deserializing untrusted model data; isolate model-loading workflows in a low-privileged sandbox; enforce model hash/signature verification; block unapproved model downloads; and train users not to open unsolicited model files.
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 Hugging Face
View allThe huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data
Unauthenticated remote code execution in HuggingFace LeRobot (versions 0 through 0.5.1) stems from pickle.loads() being
Arbitrary Python code execution in LMDeploy 0.12.1 through 0.12.2 lets an attacker who publishes a malicious model on Hu
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
Deserialization of attacker-supplied pickle data in the deprecated pandas packaged builder of Hugging Face Datasets (all
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
Path traversal in Hugging Face Datasets up to 5.0.0 allows attackers to read arbitrary local files when a victim process
Server-side request forgery in HuggingFace text-generation-inference through version 3.3.7 enables unauthenticated remot
Path traversal in Hugging Face Accelerate through 1.14.0 exposes two distinct attack outcomes when a user loads a crafte
A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe
NVD
CVE.org
EPSS
GitHub PoC
Exploit-DB