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

- Severity: High 7.8 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.70%, higher than 54% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-05-24T13:40:40.995Z
- Modified: 2026-09-10T03:50:45.254Z
- Also known as: GHSA-29pf-2h5f-8g72, PYSEC-2026-2289
- Weaknesses: CWE-502, CWE-1066
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: @huntr_ai

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

(As written by CVE List.)

## Affected

- huggingface huggingface/transformers: from unspecified before 5.3.0
- transformers (PyPI): before 5.3.0
- huggingface transformers: before 5.3.0

## Every score

- @huntr_ai: CVSS:3.0 7.8 High `CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.0 7.8 High `CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.0 7.8 High `CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://huntr.com/bounties/1f693a6e-6836-4b8b-a0bd-ca036fba8884> (exploit, evidence, third-party-advisory, web)
- <https://github.com/huggingface/transformers/commit/a7f8e7ff37d87d1a1a0c8cf607971c607741452f> (fix, patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-4372> (advisory)
- <https://github.com/huggingface/transformers> (package)
- <https://github.com/advisories/GHSA-29pf-2h5f-8g72> (advisory)

## Sources

- CVE List: [CVE-2026-4372](https://www.cve.org/CVERecord?id=CVE-2026-4372), CVE Terms of Use, modified 2026-05-26
- GitHub Advisory Database: [GHSA-29pf-2h5f-8g72](https://github.com/advisories/GHSA-29pf-2h5f-8g72), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-4372](https://nvd.nist.gov/vuln/detail/CVE-2026-4372), Public domain, modified 2026-07-23
- PyPA Advisory Database: [PYSEC-2026-2289](https://osv.dev/vulnerability/PYSEC-2026-2289), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2026-4372 · Whole record: https://cve.day/CVE-2026-4372.json · Rebuilt by cve.day 2026-11-25T22:59:22.239Z
