7.8

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

Analyzed
AliasesGHSA-29pf-2h5f-8g72PYSEC-2026-2289CGA-2h4m-2v4w-5vm3
Published 24-05-2026Last modified 26-05-2026

Vulnerability summary

CVE-2026-4372 is a high (CVSS 7.8) Missing Serialization Control Element vulnerability in huggingface huggingface/transformers. EPSS estimates a 0.70% chance of exploitation in the next 30 days, higher than 53% of scored vulnerabilities. 1 public exploit is recorded.

Priority
Prioritisepublic exploit

Public exploit (reference, Date unknown)

Source freshness unavailable

How is this decided?
CVSS score
7.8/10
010
High · v3.0 (CVE.org)
EPSS score
0.70%
0%100%
Low · +0.10 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits1reference

Advisory lineage

Upstream 0 · Downstream 0 · Related 1

Timeline

  1. 24-05-2026
    PublishedVulnerability first disclosed.
  2. 26-05-2026
    Last modifiedVulnerability information updated.

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 metrics

4 scores · 4 sources · 1 version

EPSS trend

Probability

0.70%

Chance of exploitation in the next 30 days

Percentile

53%

Versus all other CVEs

30-day change

Increase +0.10 pp

From 0.60% on 04-10-2026

04-10-202603-11-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

1 found
  • referenceUnverified

    Exploit Reference (huntr.com)

    Maturity: unknown

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: local access, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.

Chainguard11 products
  • nemo< 2.7.3-r11
  • py3.10-transformers-4.51All versions (No fix recorded)
  • py3.10-transformers-4.56All versions (No fix recorded)
  • py3.11-transformers-4.51All versions (No fix recorded)
  • py3.11-transformers-4.56All versions (No fix recorded)
Huggingface2 products
PyPI1 product
  • transformers< 5.3.0

3 vendors · 14 products

References

6 links