High severity · published May 24, 2026
CVE-2026-4372
Arbitrary Remote Code Execution via `_attn_implementation_internal` Config Injection in huggingface/transformers
7.8
CVSS
0.7%
EPSS
No
On KEV
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.
CVSS vector
CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attack vector
Local
Complexity
Low
Privileges
None
User interaction
Required
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.7% · higher than 53% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
HU
huggingface/transformers · huggingface
before 5.3.0 · source: vendor
TR
Transformers · Huggingface
before 5.3.0 · source: NVD
Affected product
HU
huggingface/transformers
huggingface
More from huggingface/transformers
9.6
CVE-2026-5241
Policy Bypass in LightGlue Nested Config Resolution in huggingface/transformers
7.8
CVE-2026-1839
Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers
7.1
CVE-2026-9856
Path Traversal in huggingface/transformers