Arbitrary Remote Code Execution via `_attn_implementation_internal` Config Injection in huggingface/transformers
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-502.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| huggingface | huggingface/transformers | before 5.3.0 | 5.3.0 | Patch available | CNA |
| — | transformers (PyPI) | before 5.3.0 | 5.3.0 | Patch available | GHSA-29pf-2h5f-8g72 |
- huggingface/transformers Vendorhuggingface Affected before 5.3.0 Fixed in 5.3.0 Patch available CNA
- transformers (PyPI) Vendor— Affected before 5.3.0 Fixed in 5.3.0 Patch available GHSA-29pf-2h5f-8g72
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:* | before 5.3.0 | Vulnerable | huggingface |
- cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:* Versions before 5.3.0 Vulnerable ·huggingface
Remediation
- Fix · CNA huggingface/transformers (huggingface) Fixed in 5.3.0
- Fix · GHSA-29pf-2h5f-8g72 transformers (PyPI) Fixed in 5.3.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-4372
- 2026-10-03 Alias added: GHSA-29pf-2h5f-8g72
- 2026-10-25 EPSS moved to the 50th–90th percentile
References
More huggingface Transformers vulnerabilities
- TI-2026-04577 Policy Bypass in LightGlue Nested Config Resolution in huggingface/transformers CVSS 3.1CRITICAL 9.6
- TI-2025-06294 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
- TI-2025-06027 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
- TI-2025-02858 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
- TI-2025-01837 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
- TI-2024-11793 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
Sources
- CVE-2026-4372 · CVE Program
- CVE-2026-4372 · NVD
- FIRST EPSS
- GHSA-29pf-2h5f-8g72 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences