{"cve":"CVE-2026-80047","nvd":{"published":"2026-09-01T14:17:41.943","modified":"2026-09-23T18:17:08.843","status":"Awaiting Analysis","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_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8},"cwes":["CWE-273","CWE-367","CWE-494"],"references":["https://github.com/huggingface/transformers","https://kb.cert.org/vuls/id/456290","https://www.kb.cert.org/vuls/id/456290"],"products":[],"source":"nvd","synced_at":"2026-10-19T22:50:50.842544443+00:00"},"epss":{"cve":"CVE-2026-80047","score":0.00099,"percentile":0.00791,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-x9r9-c232-4q39","url":"https://osv.dev/vulnerability/GHSA-x9r9-c232-4q39","summary":"Hugging Face Transformers downloads custom generation code before trust consent","modified":"2026-10-01T17:55:55.397425521Z","packages":[{"ecosystem":"PyPI","name":"transformers","purl":"pkg:pypi/transformers","ranges":[">=4.49.0 <=5.8.1"],"fixed":[]}]},{"id":"PYSEC-2026-4174","url":"https://osv.dev/vulnerability/PYSEC-2026-4174","summary":"Hugging Face Transformers downloads custom generation code before trust consent","modified":"2026-10-01T17:45:18.547440485Z","packages":[{"ecosystem":"PyPI","name":"transformers","purl":"pkg:pypi/transformers","ranges":[">=4.49.0 <=5.8.1"],"fixed":[]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}