Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.5%top 62%

CVE-2026-4372: CWE-1066 Missing Serialization Control Element in huggingface huggingface/transformers

0
High
VulnerabilityCVE-2026-4372cvecve-2026-4372cwe-1066
Published: 05/24/2026 (05/24/2026, 13:40:40 UTC)
Source: CVE Database V5
Vendor/Project: huggingface
Product: huggingface/transformers

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 v3.0

Score 7.8high

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

Affected software

transformers
pkg:pypi/transformers
Affected versions
<5.3.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/31/2026, 20:37:35 UTC

Technical Analysis

This vulnerability (CVE-2026-4372) affects all versions of the HuggingFace transformers library before 5.3.0. It arises from missing serialization control elements (CWE-1066) that allow an attacker to embed a malicious `_attn_implementation_internal` field in a model's config.json. When a victim loads the model using AutoModelForCausalLM.from_pretrained(), the library downloads and executes attacker-controlled Python code from a specified HuggingFace Hub repository with the victim's OS privileges. The flaw bypasses the trust_remote_code security mechanism due to unfiltered deserialization and unsandboxed code execution, making exploitation stealthy and severe. The vulnerability has a CVSS 3.0 score of 7.8 (high severity).

Potential Impact

Successful exploitation results in remote code execution on the victim's system with full operating system privileges. This can lead to complete system compromise, data theft, or further malicious activity. The attack is stealthy and exploits normal documented usage patterns, increasing risk to users of affected versions.

Mitigation Recommendations

Users should upgrade to HuggingFace transformers version 5.3.0 or later, where this vulnerability is fixed. No official patch link was provided, but the vendor advisory clearly states upgrading to 5.3.0+ mitigates the issue. Until upgrading, avoid loading untrusted models or config files. Patch status is confirmed by the vendor advisory recommending version 5.3.0 or later.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
@huntr_ai
Date Reserved
2026-03-18T10:04:09.683Z
Cvss Version
3.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a1304c109f6977edb6ac82b

Added to database: 05/24/2026, 14:01:37 UTC

Last enriched: 05/31/2026, 20:37:35 UTC

Last updated: 07/22/2026, 15:02:56 UTC

Views: 413

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses