Skip to main content

HuggingFace Transformers CVE-2026-4372

| EUVDEUVD-2026-31598 HIGH
Missing Serialization Control Element (CWE-1066)
2026-05-24 @huntr_ai GHSA-29pf-2h5f-8g72
7.8
CVSS 3.0 · Vendor: huntr_ai
Share

Severity by source

Vendor (huntr_ai) PRIMARY
7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Primary rating from Vendor (huntr_ai) · only source for this CVE.

CVSS VectorVendor: huntr_ai

CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
Source Code Evidence Fetched
Jun 08, 2026 - 09:33 vuln.today
Analysis Generated
Jun 08, 2026 - 09:33 vuln.today
Patch available
May 26, 2026 - 14:16 EUVD

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 73 pypi packages depend on transformers (54 direct, 20 indirect)

Ecosystem-wide dependent count for version 5.3.0.

DescriptionCVE.org

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.

AnalysisAI

Remote code execution in HuggingFace Transformers prior to 5.3.0 allows attackers to achieve arbitrary code execution on a victim's machine by publishing a malicious model whose config.json sets the _attn_implementation_internal field to an attacker-controlled Hub repository. When the victim calls the standard AutoModelForCausalLM.from_pretrained() API, the library silently downloads and executes Python kernels from that repository with the victim's privileges, bypassing the trust_remote_code safety gate. No public exploit is identified at time of analysis (EPSS 0.03%, SSVC exploitation: none), but the technical impact is total and the attack uses the documented, default usage pattern.

Technical ContextAI

HuggingFace Transformers is the dominant Python library for loading and running transformer-based ML models, identified by CPE cpe:2.3:a:huggingface:huggingface/transformers. The root cause maps to CWE-1066 (missing serialization control element): the PretrainedConfig.__init__ constructor in src/transformers/configuration_utils.py blindly applied setattr for every key in a user-supplied config.json, including internal-only fields prefixed with underscore such as _attn_implementation_internal and _experts_implementation_internal. Those fields are subsequently consumed by the Hub kernels integration (integrations/hub_kernels.py), which previously accepted any <owner>/<repo> pattern and fetched/executed the referenced kernel module. The combination - unfiltered deserialization of an internal field, plus an unsandboxed kernel-fetch-and-execute path that did not honor trust_remote_code - converts model loading into arbitrary code execution. The fix denylists the two internal fields during deserialization and restricts kernel loading to the trusted kernels-community namespace.

RemediationAI

Vendor-released patch: upgrade transformers to version 5.3.0 or later (pip install --upgrade 'transformers>=5.3.0'), which both blocks deserialization of _attn_implementation_internal and _experts_implementation_internal from hub configs and restricts kernel loading to the kernels-community namespace (commit a7f8e7ff37d87d1a1a0c8cf607971c607741452f). If immediate upgrade is not possible, compensating controls include pinning model loads to a curated allowlist of known-good repository IDs/revisions and rejecting any config.json whose keys include _attn_implementation_internal or _experts_implementation_internal before passing it to from_pretrained(); running model loading inside a network-egress-restricted sandbox (container with no outbound access to huggingface.co except a proxied mirror, or seccomp/firejail) limits the kernel download step, at the cost of breaking any legitimate dynamic kernel fetching. Note that setting trust_remote_code=False does NOT mitigate this issue because the vulnerability bypasses that mechanism. Vendor and advisory links: https://github.com/huggingface/transformers/commit/a7f8e7ff37d87d1a1a0c8cf607971c607741452f and https://huntr.com/bounties/1f693a6e-6836-4b8b-a0bd-ca036fba8884.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

CVE-2026-55255 HIGH POC
8.4 Jun 19

Cross-user flow execution in Langflow (< 1.9.1) lets any authenticated API-key holder run another user's flow by passing

Share

CVE-2026-4372 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy