Mlx lm: Hugging Face Transformers downloads custom generation code before trust consent (CVE-2026-80047)
Description
A vulnerability in Hugging Face Transformers versions 4.49.0 through 5.8.1 allows remote Python files to be written to local disk without user consent when using the GenerativePreTrainedModel.load_custom_generate() function. The function caches a remote module file before performing the trust check, causing attacker-controlled code to be saved persistently even if the user declines to trust it. Execution of this code is blocked by the trust prompt, but the unauthorized files remain on disk and may cause stale cache collisions in future trusted model loads.
CVSS v3.1
Score 7.8high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability (CVE-2026-80047) affects Hugging Face Transformers versions 4.49.0 up to 5.8.1. The GenerativePreTrainedModel.load_custom_generate() function fetches and caches a remote Python module before verifying user trust. This allows an attacker to cause arbitrary Python files to be written to the local disk without user consent. Although the execution of these files is gated by a trust prompt, the files remain on disk persistently, potentially leading to stale cache collisions in subsequent trusted model loads. The vulnerability has a CVSS 3.1 score of 7.8, indicating high severity. Patch availability is confirmed.
Potential Impact
An attacker can cause arbitrary Python files to be saved on the victim's disk without consent. While execution of these files is prevented by the trust prompt, the presence of unauthorized files may lead to stale cache collisions, potentially affecting future trusted model loads. This could undermine the integrity of the model loading process and may lead to unexpected behavior or security risks if stale or malicious code is inadvertently used.
Mitigation Recommendations
A patch is available to address this vulnerability. Users should update Hugging Face Transformers to a fixed version beyond 5.8.1. Until patched, avoid using the GenerativePreTrainedModel.load_custom_generate() function with untrusted sources. Monitor vendor advisories for official fixes and apply them promptly.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-x9r9-c232-4q39
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-80047"]
- State
- PUBLISHED
Threat ID: 6a98458bacd9273b496add74
Added to database: 09/02/2026, 15:49:31 UTC
Last enriched: 10/18/2026, 03:15:51 UTC
Last updated: 10/18/2026, 18:48:24 UTC
Views: 125
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.