CVE-2026-80047Hugging Face Transformers
NVDCVSS scored by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Vulnerability Summary
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 v3.1 Base Metrics — Score 7.8 (HIGH)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HAttack VectorLocal
Attack ComplexityLow
Privileges RequiredLow
User InteractionNone
ScopeUnchanged
ConfidentialityHigh
IntegrityHigh
AvailabilityHigh
Affected & Patched Versions
- Hugging Face Transformers >= 4.57.0 and <= 5.16.1
- Hugging Face Transformers 5.16.1
What to do
Plan remediation soon. No exploitation is confirmed yet, but the severity is high.
- Check whether you run Hugging Face Transformers and which version.
- Update to a patched version listed above, then confirm the new version.
Timeline
- Sep 1, 2026Published
- Sep 23, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new Hugging Face Transformers CVEsYou are reading CVE-2026-80047. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsRelated Coverage
More Hugging Face Transformers CVEs
External References
Data last checked: Nov 22, 2026 17:11 UTC