Hugging Face Transformers library writes remote code to disk prior to consent check
Summary
| CVE | CVE-2026-80047 |
|---|---|
| State | PUBLISHED |
| Assigner | certcc |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-09-01 14:17:41 UTC |
| Updated | 2026-09-03 17:53:32 UTC |
| Description | 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 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. |
Risk And Classification
Primary CVSS: v3.1 7.8 HIGH from ADP
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS: 0.000820000 probability, percentile 0.002330000 (date 2026-09-04)
Problem Types: CWE-273 | CWE-367 | CWE-494 | CWE-273 Improper Check for Dropped Privileges | CWE-367 Time-of-Check Time-of-Use (TOCTOU Race Condition) | CWE-494 Download of Code Without Integrity Check | CWE-273 CWE-273 Improper Check for Dropped Privileges | CWE-367 CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition | CWE-494 CWE-494 Download of Code Without Integrity Check
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | ADP | DECLARED | 7.8 | HIGH | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| 3.1 | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | Secondary | 7.8 | HIGH | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
CVSS v3.1 Breakdown
Attack Vector
LocalAttack Complexity
LowPrivileges Required
LowUser Interaction
NoneScope
UnchangedConfidentiality
HighIntegrity
HighAvailability
HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Hugging Face | Transformers | affected 4.49.0 5.8.1 custom | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| kb.cert.org/vuls/id/456290 | [email protected] | kb.cert.org | |
| www.kb.cert.org/vuls/id/456290 | af854a3a-2127-422b-91ae-364da2661108 | www.kb.cert.org | |
| github.com/huggingface/transformers | [email protected] | github.com | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
No vendor comments have been submitted for this CVE.
There are currently no legacy QID mappings associated with this CVE.