# CVE-2026-4372: Arbitrary Remote Code Execution via `_attn_implementation_internal` Config Injection in huggingface/transformers

> CVE-2026-4372: Arbitrary Remote Code Execution via `_attn_implementation_internal` Config Injection in huggingface/transformers. CVSS 7.8 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2026-4372
Last updated: 2026-07-23T17:10:00Z

- Published: 2026-05-24 13:40 UTC · Updated: 2026-07-23 17:10 UTC · Assigner: @huntr\_ai
- CVSS: 7.8 (CVSS 3.1) · Severity: High · Vector: CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- EPSS: 0.70%, 53th percentile (scored 2026-10-25)
- CISA KEV: no
- CWE: CWE-1066

## 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.

## Affected vendors and products

- huggingface: huggingface/transformers

## Tracked companies

- [Hugging Face](https://rewindex.com/company/hugging-face.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2026-4372)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2026-4372)
- [https://github.com/huggingface/transformers/commit/a7f8e7ff37d87d1a1a0c8cf607971c607741452f](https://github.com/huggingface/transformers/commit/a7f8e7ff37d87d1a1a0c8cf607971c607741452f)
- [https://huntr.com/bounties/1f693a6e-6836-4b8b-a0bd-ca036fba8884](https://huntr.com/bounties/1f693a6e-6836-4b8b-a0bd-ca036fba8884)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2026-4372 · Markdown: https://rewindex.com/cve/CVE-2026-4372.md · JSON: https://rewindex.com/api/v1/cves/CVE-2026-4372 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T02:05:18.309Z
