# CVE-2026-80047: Hugging Face Transformers library writes remote code to disk prior to consent check

> CVE-2026-80047: Hugging Face Transformers library writes remote code to disk prior to consent check. CVSS 7.8 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2026-80047
Last updated: 2026-09-23T18:17:08Z

- Published: 2026-09-01 13:40 UTC · Updated: 2026-09-23 18:17 UTC · Assigner: certcc
- CVSS: 7.8 (CVSS 3.1) · Severity: High · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.10%, 1th percentile (scored 2026-10-25)
- CISA KEV: no

## 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.

## Affected vendors and products

- Hugging Face: Transformers

## Tracked companies

- [Hugging Face](https://rewindex.com/company/hugging-face.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2026-80047)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2026-80047)
- [https://github.com/huggingface/transformers](https://github.com/huggingface/transformers)
- [https://kb.cert.org/vuls/id/456290](https://kb.cert.org/vuls/id/456290)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2026-80047 · Markdown: https://rewindex.com/cve/CVE-2026-80047.md · JSON: https://rewindex.com/api/v1/cves/CVE-2026-80047 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T03:10:47.534Z
