CVE-2026-4372
Description
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.
Weakness
- CWE-1066: Missing Serialization Control Element
CISA SSVC decision points
| Exploitation | none |
|---|---|
| Automatable | no |
| Technical impact | total |
| Scored | 2026-05-26 |
Timeline
- 2026-05-24Published by the CNA13:40 UTC
- 2026-05-26GitHub advisory published (GHSA-29pf-2h5f-8g72)2 days after publication
- 2026-05-26CISA SSVC decision recorded2 days after publication
Exploit and advisory records
GitHub advisory GHSA-29pf-2h5f-8g72, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| PyPI transformers | before 5.3.0 | 5.3.0 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| huggingface transformers | before 5.3.0fixed in 5.3.0 | 5.3.0 |
References
- https://github.com/huggingface/transformers/commit/a7f8e7ff37d87d1a1a0c8cf607971c607741452f
- https://huntr.com/bounties/1f693a6e-6836-4b8b-a0bd-ca036fba8884
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2026-4372'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2026-4372'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2026-4372'curl 'https://api.contrastcyber.com/cve_products/CVE-2026-4372'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).