cve.bz

CVE-2026-80047 hugging face transformers: Improper Check for Dropped Privileges

7.8 highEPSS 0.10%

High (7.8) in hugging face transformers. EPSS 0.10% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
0.10% (unchanged from 0.10% a week ago; 0.10% 30 days ago) estimated probability of exploitation activity in the next 30 days; 1st percentile. Scored 2026-11-24. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-09-03. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
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
OWASP Top 10
A08:2025 Software or Data Integrity Failures
Published
Modified
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Ask an AI about this CVE

Show the promptExplain CVE-2026-80047 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-80047?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-80047?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-80047 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Hugging Face Transformersfrom 4.57.0 through 5.16.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-x9r9-c232-4q39PyPItransformers>=4.49.0 <=5.8.1no fix published
PYSEC-2026-4174PyPItransformers>=4.49.0 <=5.8.1no fix published

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

Red Hat Product Security has determined that this issue affects Red Hat OpenShift AI, Red Hat Enterprise Linux AI, Ansible Automation Platform Lightspeed, and OpenShift Lightspeed products that bundle the Hugging Face Transformers library (versions 4.49.0 through 5.8.1). The vulnerability allows remote Python files to be written to the user's local cache without consent when using the GenerativePreTrainedModel.load_custom_generate() function. While code execution is correctly gated behind trust verification, the unauthorized file write can result in persistent malicious files that may later be executed during subsequent trusted model loads via cache collisions. The impact is limited to scenarios where users load models from attacker-controlled repositories.

Red Hat's mitigation

Until a fix is available, users should only load models from trusted repositories. Avoid using the GenerativePreTrainedModel.load_custom_generate() function with models from untrusted or unknown sources. Organizations should implement controls to restrict which model repositories their AI/ML workloads can access.

ProductPackageStateAdvisory
Lightspeed Corelightspeed-core/lightspeed-stack-rhel9Fix deferred
Lightspeed Corelightspeed-core/rag-tool-cpu-rhel9Fix deferred
Lightspeed Corelightspeed-core/rag-tool-cuda-12.9-rhel9Fix deferred
OpenShift Lightspeedopenshift-lightspeed/lightspeed-ocp-rag-rhel9Fix deferred
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Fix deferred
OpenShift Lightspeedopenshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9Fix deferred
Red Hat AI Inference Serverrhaii/model-opt-cuda-rhel9Fix deferred
Red Hat AI Inference Serverrhaiis/model-opt-cuda-rhel9Fix deferred
Red Hat AI Inference Serverrhaiis/vllm-cpu-rhel9Fix deferred
Red Hat AI Inference Serverrhaiis/vllm-cuda-rhel9Fix deferred
Red Hat AI Inference Serverrhaiis/vllm-neuron-rhel9Fix deferred
Red Hat AI Inference Serverrhaiis/vllm-rocm-rhel9Fix deferred
Red Hat AI Inference Serverrhaiis/vllm-spyre-rhel9Fix deferred
Red Hat AI Inference Serverrhaiis/vllm-tpu-rhel9Fix deferred
Red Hat AI Inference Serverrhaii/vllm-cpu-rhel9Fix deferred
Red Hat AI Inference Serverrhaii/vllm-cuda-rhel9Fix deferred
Red Hat AI Inference Serverrhaii/vllm-gaudi-rhel9Fix deferred
Red Hat AI Inference Serverrhaii/vllm-neuron-rhel9Fix deferred
Red Hat AI Inference Serverrhaii/vllm-rocm-rhel9Fix deferred
Red Hat AI Inference Serverrhaii/vllm-spyre-rhel9Fix deferred
55 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-80047.

Attack patterns (CAPEC)

  • CAPEC-27 Leveraging Race Conditions via Symbolic Links Likelihood: Medium · Severity: High
  • CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-494 (12).

References

Check your stackJSON