CVE-2026-4372 json
Arbitrary Remote Code Execution via `_attn_implementation_internal` Config Injection in huggingface/transformers
published 2026-05-24 5 mo ago modified 2026-09-10 1 mo ago also GHSA-29pf-2h5f-8g72 , PYSEC-2026-2289 , EUVD-2026-31598
- cvss
- 7.8
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.7%
- EPSS 0.7% chance of exploitation in 30 days, percentile 53%
- public exploits
- 0
- none known
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.
Patch / fix
- pypi transformers 5.3.0
- huggingface huggingface/transformers 5.3.0
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 5 mo ago
Exploit prediction
0.70% chance of exploitation in the next 30 days, higher than 53% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- huntr.com https://huntr.com/bounties/1f693a6e-6836-4b8b-a0bd-ca036fba8884 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 7.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 3.0 | 7.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | 3.0 | 7.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | transformers | <5.3.0 |
5.3.0 |
Affected products
- huggingface huggingface/transformers
Classification
References
-
github.com
/huggingface/transformers/commit/a7f8e7ff37d87d1a1a0c8cf607971c607741452f
web, patch
-
huntr.com
/bounties/1f693a6e-6836-4b8b-a0bd-ca036fba8884
web, exploit, third-party-advisory, evidence
-
nvd.nist.gov
/vuln/detail/CVE-2026-4372
advisory
-
github.com
/huggingface/transformers
package
-
github.com
/advisories/GHSA-29pf-2h5f-8g72
advisory
Sources
- CVE List CVE-2026-4372
- GitHub Advisory GHSA-29pf-2h5f-8g72
- NVD CVE-2026-4372
- OSV PYSEC-2026-2289
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.