BreachSpiderVerified, not vibes

CVE-2026-80047 in Huggingface Transformers

High 7.8

A vulnerability in Hugging Face Transformers (versions 4.57.0 to 5.16.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 conse...

Affects 1 product from 1 vendor. Facts below cite their sources.

CVSS 3.17.8
EPSS0.1%
EPSS percentile0th
FixUnknown

Requires local access, low complexity, low privileges required, no user interaction needed, impact contained to the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Huggingface Transformers ≥ 4.57.0, ≤ 5.16.1

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

No official vendor advisory link on record. See the CVE record.

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official description

A vulnerability in Hugging Face Transformers (versions 4.57.0 to 5.16.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.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2026-80047
CVSS vectorCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Published2026-09-01
Last modified2026-09-23
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-273: CWE-273

CWE-367: CWE-367

CWE-494: CWE-494

Related attack patterns (CAPEC)

CAPEC-27 Leveraging Race Conditions via Symbolic Links via CWE-367

CAPEC-187 Malicious Automated Software Update via Redirection via CWE-494

CAPEC-533 Malicious Manual Software Update via CWE-494

CAPEC-538 Open-Source Library Manipulation via CWE-494

CAPEC-657 Malicious Automated Software Update via Spoofing via CWE-494

Show all 14

CAPEC-692 Spoof Version Control System Commit Metadata via CWE-494

CAPEC-693 StarJacking via CWE-494

CAPEC-695 Repo Jacking via CWE-494

CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions via CWE-367

CAPEC-185 Malicious Software Download via CWE-494

CAPEC-186 Malicious Software Update via CWE-494

CAPEC-662 Adversary in the Browser (AiTB) via CWE-494

CAPEC-691 Spoof Open-Source Software Metadata via CWE-494

CAPEC-184 Software Integrity Attack via CWE-494

Mapping is CWE to CAPEC per MITRE CAPEC 3.9.

Analysis AI-written, not human-reviewed

A unscored severity vulnerability (CVE-2026-80047) affects the target system. A vulnerability in Hugging Face Transformers (versions >= 4.49.0 and <= 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 ...

Questions

What is CVE-2026-80047?

A unscored severity vulnerability (CVE-2026-80047) affects the target system. A vulnerability in Hugging Face Transformers (versions >= 4.49.0 and <= 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 ...

What is the CVSS score for CVE-2026-80047?

CVE-2026-80047 has CVSS 7.8 (High). Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. EPSS: 0.1%.

Is CVE-2026-80047 actively exploited?

No confirmed active exploitation of CVE-2026-80047 as of 2026-09-25.

How do I remediate CVE-2026-80047?

Apply vendor patches for CVE-2026-80047. Monitor Huggingface advisories.

What systems are affected by CVE-2026-80047?

CVE-2026-80047 affects Huggingface Transformers.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Huggingface","product":"Transformers","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-09-23.