Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconPublish malicious model to HuggingFace Hub
-
DeliveryEmbed `_attn_implementation_internal` repo ID in config.json
-
ExploitVictim calls `AutoModelForCausalLM.from_pretrained()`
-
InstallLibrary deserializes internal field via setattr
-
C2Kernel module fetched from attacker repo
-
ExecutePython code executes with user privileges
-
ImpactCredential theft or lateral movement
Vulnerability Assessment
| Weakness |
CWE
|
| Exploitation Conditions | Exploitation requires that the victim invoke a |
| Impact | Signals conflict and need to be weighed carefully. CVSS is 7.8 with vector AV:L/AC:L/PR:N/UI:R/C:H/I:H/A:H - NVD scored this as Local with required user interaction (loading a model), but in practice the malicious payload is delivered over the network via the Hugging Face Hub, so real-world reach is broader than 'local' suggests. SSVC reports Exploitation: none, Automatable: no, Technical Impact: total, and EPSS is just 0.03% (9th percentile) with no KEV listing and no public exploit identified at time of analysis. That said, the attack abuses the standard, documented |
| Exploit ScenarioDerived | An attacker publishes a benign-looking model to the Hugging Face Hub (or convinces a victim to download a model archive) whose config.json contains |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 08, 2026
Remote code execution in HuggingFace Transformers prior to 5.3.0 allows attackers to achieve arbitrary code execution on a victim's machine by publishing a malicious model whose config.json sets the _attn_implementation_internal field to an attacker-controlled Hub repository. When the victim calls the standard AutoModelForCausalLM.from_pretrained() API, the library silently downloads and executes Python kernels from that repository with the victim's privileges, bypassing the trust_remote_code safety gate. No public exploit is identified at time of analysis (EPSS 0.03%, SSVC exploitation: none), but the technical impact is total and the attack uses the documented, default usage pattern.
RemediationAI
Vendor-released patch: upgrade transformers to version 5.3.0 or later (pip install --upgrade 'transformers>=5.3.0'), which both blocks deserialization of _attn_implementation_internal and _experts_implementation_internal from hub configs and restricts kernel loading to the kernels-community namespace (commit a7f8e7ff37d87d1a1a0c8cf607971c607741452f). If immediate upgrade is not possible, compensating controls include pinning model loads to a curated allowlist of known-good repository IDs/revisions and rejecting any config.json whose keys include _attn_implementation_internal or _experts_implementation_internal before passing it to from_pretrained(); running model loading inside a network-egress-restricted sandbox (container with no outbound access to huggingface.co except a proxied mirror, or seccomp/firejail) limits the kernel download step, at the cost of breaking any legitimate dynamic kernel fetching. Note that setting trust_remote_code=False does NOT mitigate this issue because the vulnerability bypasses that mechanism. Vendor and advisory links: https://github.com/huggingface/transformers/commit/a7f8e7ff37d87d1a1a0c8cf607971c607741452f and https://huntr.com/bounties/1f693a6e-6836-4b8b-a0bd-ca036fba8884.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in pypi, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
HuggingFace Transformers is the dominant Python library for loading and running transformer-based ML models, identified by CPE cpe:2.3:a:huggingface:huggingface/transformers. The root cause maps to CWE-1066 (missing serialization control element): the PretrainedConfig.__init__ constructor in src/transformers/configuration_utils.py blindly applied setattr for every key in a user-supplied config.json, including internal-only fields prefixed with underscore such as _attn_implementation_internal and _experts_implementation_internal. Those fields are subsequently consumed by the Hub kernels integration (integrations/hub_kernels.py), which previously accepted any <owner>/<repo> pattern and fetched/executed the referenced kernel module. The combination - unfiltered deserialization of an internal field, plus an unsandboxed kernel-fetch-and-execute path that did not honor trust_remote_code - converts model loading into arbitrary code execution. The fix denylists the two internal fields during deserialization and restricts kernel loading to the trusted kernels-community namespace.
Know when Hugging Face gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Primary rating from Vendor (huntr_ai) · only source for this CVE.
CVSS VectorVendor: huntr_ai
Lifecycle Timeline
1DescriptionCVE.org
A critical remote code execution vulnerability exists in all versions of the HuggingFace transformers library prior to version 5.3.0. The vulnerability allows an attacker to craft a malicious config.json file containing the _attn_implementation_internal field set to an attacker-controlled HuggingFace Hub repository ID. When a victim loads this model using the standard AutoModelForCausalLM.from_pretrained() API, the library downloads and executes arbitrary Python code from the attacker's repository with the victim's full OS privileges. This issue arises due to unfiltered deserialization of configuration attributes, insufficient sanitization of internal fields, and unsandboxed execution of downloaded kernels. The vulnerability bypasses the trust_remote_code security mechanism, is invisible to the victim, and exploits the standard documented usage pattern, making it particularly severe. Users are advised to upgrade to version 5.3.0 or later to mitigate this issue.
Blast Radius
ecosystem impact- 61 pypi packages depend on transformers (47 direct, 15 indirect)
Ecosystem-wide dependent count for version 5.3.0.
Executive ViewAI
HuggingFace Transformers prior to 5.3.0 enables remote code execution through a supply-chain attack targeting organizations whose ML and data science teams download models from HuggingFace Hub. Attackers can inject arbitrary code execution into development and production servers via malicious models through the library's standard from_pretrained() API. This vulnerability exploits a trusted, well-documented operation pattern that most organizations using HuggingFace consider safe.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
More in Hugging Face
View allThe huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data
Unauthenticated remote code execution in HuggingFace LeRobot (versions 0 through 0.5.1) stems from pickle.loads() being
Arbitrary Python code execution in LMDeploy 0.12.1 through 0.12.2 lets an attacker who publishes a malicious model on Hu
Deserialization of attacker-supplied pickle data in the deprecated pandas packaged builder of Hugging Face Datasets (all
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,
The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (R
Path traversal in Hugging Face Datasets up to 5.0.0 allows attackers to read arbitrary local files when a victim process
Server-side request forgery in HuggingFace text-generation-inference through version 3.3.7 enables unauthenticated remot
Path traversal in Hugging Face Accelerate through 1.14.0 exposes two distinct attack outcomes when a user loads a crafte
A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe
EUVD-2026-31598
GHSA-29pf-2h5f-8g72
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB