CVE-2026-4372 Details
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.
A critical remote code execution vulnerability exists in all versions of the Hugging Face Transformers library prior to 5.3.0. This vulnerability allows an attacker to inject a malicious `config.json` file with the `_attn_implementation_internal` field pointing to an attacker-controlled Hugging Face Hub repository. When the model is loaded using the `AutoModelForCausalLM.from_pretrained()` API, the library downloads and executes arbitrary Python code from the attacker's repository with the victim's full operating system privileges. The issue stems from unfiltered deserialization of configuration attributes, inadequate sanitization of internal fields, and unsandboxed execution of downloaded kernels. Notably, this vulnerability bypasses the `trust_remote_code` security mechanism, goes unnoticed by the victim, and exploits a standard usage pattern, making it particularly severe.
Users are advised to upgrade to version 5.3.0 or later.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed May 26, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/huggingface/transformers/commit/a7f8e7ff37d87d1a1a0c8cf607971c607741452f | [email protected] | Patch |
| https://huntr.com/bounties/1f693a6e-6836-4b8b-a0bd-ca036fba8884 | [email protected] | ExploitThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-502 | Deserialization of Untrusted Data | [email protected] |
| CWE-1066 | Missing Serialization Control Element | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| huggingface transformers | < 5.3.0 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 23, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 4, 2026 | Initial Analysis | [email protected] |
| May 24, 2026 | New CVE Received | [email protected] |