CVE-2026-80047: Hugging Face Transformers library writes remote code to disk prior to consent check
Vulnerability summary
CVE-2026-80047 is a high (CVSS 7.8) Improper Check for Dropped Privileges vulnerability in hugging face transformers. EPSS estimates a 0.10% chance of exploitation in the next 30 days, higher than 0.7% of scored vulnerabilities.
Not severe (CVSS 7.8, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 01-09-2026PublishedVulnerability first disclosed.
- 23-09-2026Last modifiedVulnerability information updated.
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.
CVSS metrics
4 scores · 4 sources · 1 version- OSV · PypiEcosystem advisory · calculated7.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- OSV · ChainguardEcosystem advisory · calculated7.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- NVDNIST7.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
0.10%
Chance of exploitation in the next 30 days
Percentile
1%
Versus all other CVEs
30-day change
No change 0.00 pp
From 0.10% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-273Improper Check for Dropped PrivilegesThe product attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.
- CWE-367Time-of-check Time-of-use (TOCTOU) Race ConditionThe product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.
- CWE-494Download of Code Without Integrity CheckThe product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.
Affected systems
Known conditions: local access, low-privilege account, no user interaction (CVSS vector). Other conditions: not stated in public data.
Chainguard8 products
- py3.10-transformers-4.51All versions (No fix recorded)
- py3.10-transformers-4.56All versions (No fix recorded)
- py3.11-transformers-4.51All versions (No fix recorded)
- py3.11-transformers-4.56All versions (No fix recorded)
- py3.12-transformers-4.51All versions (No fix recorded)
Hugging face1 product
- transformers≥ 4.57.0, ≤ 5.16.1
PyPI1 product
- transformers≥ 4.49.0, ≤ 5.8.1
3 vendors · 10 products