CVE-2026-4372Huggingface Transformers
NVDCVSS scored by security@huntr.dev
Vulnerability 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.
CVSS v3.0 Base Metrics — Score 7.8 (HIGH)
CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HAttack VectorLocal
Attack ComplexityLow
Privileges RequiredNone
User InteractionRequired
ScopeUnchanged
ConfidentialityHigh
IntegrityHigh
AvailabilityHigh
Affected & Patched Versions
- Huggingface Transformers < 5.3.0
- huggingface/transformers >= unspecified and < 5.3.0
- Huggingface Transformers 5.3.0
- huggingface/transformers 5.3.0
What to do
Prioritize this fix. Exploit code is public, so attacks can follow quickly.
- Check whether you run Huggingface Transformers and which version.
- Update to a patched version listed above, then confirm the new version.
- Review logs and exposed services for signs of earlier compromise.
Timeline
- May 24, 2026Published
- Jul 23, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new Huggingface Transformers CVEsYou are reading CVE-2026-4372. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsMore Huggingface Transformers CVEs
External References
Data last checked: Nov 22, 2026 17:11 UTC