Skip to main content

Hugging Face Transformers EUVDEUVD-2026-69144

| CVE-2026-80047 HIGH
Improper Check for Dropped Privileges (CWE-273)
2026-09-01 certcc GHSA-x9r9-c232-4q39
7.8
CVSS 3.1 · Vendor: certcc
View

Attack ChainAIDerived

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

  1. Recon
    Attacker uploads malicious generate.py to controlled model repo
  2. Delivery
    Victim calls load_custom_generate() on attacker-controlled model
  3. Exploit
    Library fetches remote file before trust_remote_code check
  4. Install
    Malicious Python written unconditionally to ~/.cache/huggingface/modules/
  5. C2
    User declines trust prompt but file persists on disk
  6. Execute
    Future trusted model load resolves poisoned cache entry
  7. Impact
    Attacker code executes in victim Python environment

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V8 - Authorization Privilege drop verification
Exploitation Conditions

The user must explicitly call GenerativePreTrainedModel.load_custom_generate() on a model repository controlled by the attacker - this function is not invoked automatically by standard model loading via AutoModel or AutoTokenizer, so users of standard loading paths are unaffected. The attacker must control or compromise a Hugging Face Hub model repository and place a malicious custom_generate/generate.py within it. Immediate arbitrary code execution is limited by the trust_remote_code gate that correctly fires after the file write; actual execution of the cached malicious module requires a subsequent model load that resolves against the poisoned cache entry without triggering a fresh consent check. Users who do not call load_custom_generate(), who only load models from verified repositories, or who routinely clear ~/.cache/huggingface/modules/ face negligible residual risk.

Impact

The provided CVSS 7.8 with AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H overstates the impact in several dimensions. The attack vector is arguably AV:N, not AV:L: the attacker controls a remote model repository, and the victim fetches from it - however, user interaction is required (UI:R). C:H and A:H reflect the secondary, conditional threat of eventual code execution via cache poisoning rather than the confirmed direct impact, which is an unauthorized file write (I:H); the description explicitly states execution is correctly gated. EPSS of 0.11% at the 1st percentile confirms very low current exploitation probability. There is no CISA KEV listing and no public PoC. Real-world risk is moderate and largely confined to ML developers and researchers who call load_custom_generate() against third-party or untrusted model repositories. The cache-collision execution path requires a specific sequence - a poisoned cache entry surviving into a future trusted model load - which is plausible but not automatic. CVSS vector metric AV:L appears inconsistent with the described remote-repository attack scenario; verify with vendor.

Exploit ScenarioDerived

An attacker publishes a malicious Hugging Face model repository containing a weaponized custom_generate/generate.py. A developer calls load_custom_generate() on this model; Transformers silently fetches and writes the malicious Python file to ~/.cache/huggingface/modules/ before presenting the trust prompt. Even if the user declines, the file persists and may be silently loaded in a future session when a trusted model triggers module cache resolution against the poisoned entry.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.1% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Sep 03, 2026

Write-before-consent in Hugging Face Transformers' GenerativePreTrainedModel.load_custom_generate() allows attacker-controlled Python files to be silently written to ~/.cache/huggingface/modules/ even when the user declines the trust prompt. Affected versions span 4.49.0 through 5.8.1. While immediate execution is blocked by the trust gate, the persisted cache file creates a stale-cache collision risk: subsequent loads of unrelated trusted models may inadvertently execute the previously cached, attacker-supplied Python code. No public exploit has been identified at time of analysis.

RemediationAI

Upgrade Hugging Face Transformers to a version beyond 5.8.1 when a patched release is published; monitor https://github.com/huggingface/transformers for a fix targeting dynamic_module_utils.py. No vendor-released patch version has been independently confirmed at time of analysis - the fix version is unknown and should not be assumed. As an immediate compensating control, avoid calling GenerativePreTrainedModel.load_custom_generate() with models from repositories you do not own or have not independently verified; this eliminates the attack surface entirely since the vulnerable code path is not triggered by standard AutoModel/AutoTokenizer loading. Additionally, periodically clear ~/.cache/huggingface/modules/ to remove any stale or potentially unauthorized cached Python modules, directly mitigating the cache-collision execution risk (trade-off: cache re-population on next load). Restrict trust_remote_code use to model repositories under organizational control. See CERT/CC VU#456290 for additional guidance.

Affected VersionsENISA

Transformers 4.49.0 ≤5.8.1

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

Hugging Face Transformers is a widely deployed Python ML library for loading and using pre-trained models. The affected code path lives in dynamic_module_utils.py, which handles dynamic loading of Python modules from remote model repositories. The function load_custom_generate() inside GenerativePreTrainedModel fetches and unconditionally writes the remote custom_generate/generate.py to the local HuggingFace module cache before invoking the trust_remote_code consent check - inverting the security model used by all other loaders (AutoConfig, AutoModel, AutoTokenizer), which gate the file write behind user consent. CWE-273 (Improper Check for Dropped Privileges) captures the pattern: a security-relevant operation (file write to a Python module directory) proceeds before verifying the required authorization (user consent), meaning the authorization decision is rendered moot for the file persistence effect even when enforced for execution. CPE: cpe:2.3:a:hugging_face:transformers:*:*:*:*:*:*:*:*.

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 (certcc) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 5.9 MEDIUM

Attacker is remote (controls model repo, UI:R for victim action); confirmed impact is unauthorized file write (I:H); code execution is conditional on cache collision (C:L, A:N).

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

Primary rating from Vendor (certcc).

CVSS VectorVendor: certcc

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

Lifecycle Timeline

3
CVSS changed
Sep 03, 2026 - 15:22 NVD
7.8 (HIGH)
CVE Published
Sep 01, 2026 - 13:40 cve.org
UNKNOWN (no severity yet)
CVE Published
Sep 01, 2026 - 13:40 cve.org
HIGH 7.8

DescriptionCVE.org

A vulnerability in Hugging Face Transformers (versions 4.49.0, <= 5.8.1) allows remote Python files to be written to local disk without user consent when using GenerativePreTrainedModel.load_custom_generate(). The function fetches and caches a remote module file before performing the required trust_remote_code consent check, inverting the security model enforced by other code-loading paths (such as AutoConfig, AutoModel, and AutoTokenizer). As a result, attacker‑controlled Python code from custom_generate/generate.py is copied into the user’s ~/.cache/huggingface/modules directory even if the user declines the trust prompt. Although execution is correctly gated, the file write is not reversible and can persist across sessions. This can lead to persistent, unauthorized files on disk and stale cache collisions where cached attacker code may later be executed during trusted model loads. The issue stems from an unconditional file write in dynamic_module_utils.py prior to any trust verification.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 66 pypi packages depend on transformers (61 direct, 5 indirect)

Ecosystem-wide dependent count for version 4.49.0.

Executive ViewAI

Why It Matters

Hugging Face Transformers (versions 4.49.0-5.8.1) contains a cache-poisoning vulnerability allowing attackers to persist malicious Python code in user caches despite explicit trust rejection. This creates supply-chain risk where subsequent model loads may unknowingly execute persisted attacker payloads. Organizations deploying Hugging Face for ML inference lack immediate patch mitigation, creating undetected code-execution exposure in production AI pipelines.

Business Impact: High
Compensating Controls

Clear and isolate model cache directories (~/.cache/huggingface/modules/); restrict model loading to curated internal sources only; implement model provenance logging and validation; disable dynamic model downloads in production environments; consider network-level restrictions on Hugging Face Hub access where feasible.

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
Prevalence
High
dominant Python ML library, massive research and production deployment
Threat Intel
1
1 sources
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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.1%
Patch available No
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
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

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

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

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