Skip to main content

Hugging Face Transformers CVE-2025-14924

HIGH
Deserialization of Untrusted Data (CWE-502)
2025-12-23 zdi-disclosures@trendmicro.com
7.8
CVSS 3.0 · Vendor: trendmicro
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious megatron_gpt2 checkpoint
  2. Delivery
    Deliver via model hub or file
  3. Exploit
    Victim loads checkpoint in Transformers
  4. Execution
    Untrusted data deserialized (CWE-502)
  5. Impact
    Arbitrary 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

pypi transformers no fix

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

Vendor (trendmicro) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

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.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Red Hat 8.8 HIGH

Primary rating from Vendor (trendmicro).

CVSS VectorVendor: trendmicro

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 4 pypi packages depend on transformers (4 direct, 0 indirect)

Ecosystem-wide dependent count for version 4.55.0.

Executive ViewAI

Why It Matters

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.

Business Impact: Medium
Compensating Controls

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

EPSS Score
0.3%
Top 75% exploitable
Prevalence
High
Hugging Face Transformers is among the most widely deployed ML libraries
Data Quality
3 sources
Confidence: Low

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
Medium

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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

cpe:2.3:a:huggingface:transformers:4.55.0:*:*:*:*:*:*:*
CVE-2024-3568 CRITICAL POC
9.6 Apr 10

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data

CVE-2023-6730 HIGH POC
8.8 Dec 19

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS

CVE-2023-7018 HIGH POC
7.8 Dec 20

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS

CVE-2025-3262 HIGH POC
7.5 Jul 07

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,

CVE-2025-6921 HIGH POC
7.5 Sep 23

The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (R

CVE-2025-1194 MEDIUM POC
6.5 Apr 29

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe

CVE-2026-5241 CRITICAL
9.6 Jun 03

Remote code execution in Hugging Face Transformers 5.2.0 allows a malicious model repository to bypass the user's explic

CVE-2025-3264 MEDIUM POC
5.3 Jul 07

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp

CVE-2025-3263 MEDIUM POC
5.3 Jul 07

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp

CVE-2025-6051 MEDIUM POC
5.3 Sep 14

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp

CVE-2025-3933 MEDIUM POC
5.3 Jul 11

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp

CVE-2024-11394 HIGH POC
8.8 Nov 22

Hugging Face Transformers Trax Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. Rated high s

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy