CVE-2026-80047: Hugging Face Transformers Allows Unauthorized File Write Before Trust Consent

transformers Updated 01 Oct 2026

Summary

01/09/2026
No i
High
7.8

CVE-2026-80047: Hugging Face Transformers downloads custom generation code before trust consent. Affects transformers versions >= 4.49.0, <= 5.8.1. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Hugging Face Transformers is a widely-used library for natural language processing that provides pre-trained models and tools for generating text. It allows developers to easily implement state-of-the-art machine learning models in their applications. However, certain versions of this library have a vulnerability that compromises user trust and security by allowing unauthorized file writes.

Vulnerability Detail

A vulnerability in Hugging Face Transformers (versions 4.49.0 to 5.8.1) allows remote Python files to be written to the local disk without user consent when using the GenerativePreTrainedModel.load_custom_generate() function. This function fetches and caches a remote module file before performing the required trust_remote_code consent check, which inverts the expected security model. As a result, attacker-controlled Python code can be copied into the user's cache directory even if the user declines the trust prompt. Although the execution of this code is gated, the file write is irreversible and can persist across sessions, leading to unauthorized files on disk and potential stale cache collisions during trusted model loads. The issue arises from an unconditional file write in dynamic_module_utils.py prior to any trust verification.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using the GenerativePreTrainedModel.load_custom_generate() function until you can update to a secure version. Additionally, regularly clear your cache directory located at ~/.cache/huggingface/modules to remove any unauthorized files.

Conclusion

The vulnerability identified as CVE-2026-80047 in Hugging Face Transformers poses a significant risk by allowing unauthorized file writes without user consent. It is crucial for users to update to the latest version of the library to mitigate this risk and ensure the security of their applications.

See every vulnerability recorded for transformers →

Share this vulnerability

FAQ

The vulnerability affects Hugging Face Transformers versions 4.49.0 through 5.8.1.

The risks include unauthorized file writes to the user's disk, which can lead to persistent malicious code and potential execution during trusted model loads.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score of this vulnerability is 7.8, indicating a high severity level.

Yes, you can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities in your software by analyzing the Pipfile.lock.

Related vulnerabilities

Recent vulnerabilities recorded for transformers.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback