CVE-2026-80047Hugging Face Transformers time-of-check time-of-use race condition
CVSS score
7.8
High
CVSS 3.1 from 134c704f-9b21-4f2e-91b3-4a467353bcc0
Exploit probability (EPSS)
0.10%
0.10% chance of exploitation in the next 30 days, higher than 0.78% of all CVEs.
CISA KEV
Not in KEV
No confirmed exploitation reported by CISA so far.
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: NVD · CNA: cret@cert.org
How to fix it, step by step
Check whether you're affected
Find every system running Hugging Face Transformers and compare its version with the affected versions.
Watch for an official fix
No fix or advisory is listed in the official record yet. Follow the vendor's security announcements; this page updates when one is published.
Was this useful?
How it can be exploited
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Values in red make the vulnerability easier to exploit or more damaging. CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected products
| Affected products | Versions |
|---|---|
| Hugging Face Transformers | ≥ 4.57.0, ≤ 5.16.1 |
Weakness
Timeline
- Published:
- Last modified:
Frequently asked questions
Is CVE-2026-80047 being exploited?
There is no confirmed exploitation in CISA's KEV catalog so far. Its EPSS score estimates a 0.1% probability of exploitation in the next 30 days.
What is the CVSS score of CVE-2026-80047?
CVE-2026-80047 has a CVSS 3.1 base score of 7.8 (high).
Which versions are affected?
Hugging Face Transformers (≥ 4.57.0, ≤ 5.16.1)
Is there a patch for CVE-2026-80047?
No patch is linked in the official record yet. Watch the vendor's security advisories.
References
Data: NVD, CVE.org (cvelistV5), CISA KEV and FIRST EPSS. Summary written by RedCVE with AI assistance from the official data.