Security Resilience

CVE-2026-4372

Deserialization in Huggingface Transformers ≤ 5.3.0

Public PoCDeserialization
Published
24 May 2026
Modified
23 July 2026
Patch / advisory
CVSS Score v3 7.8
Click a component to see what it means
Raw vectorCVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Score 0.0060 43th percentile
Risk Priority 58 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). EPSS, Forum of Incident Response and Security Teams (FIRST), epss.first.org. Risk Priority is our own derived reading, not an NVD score.

Summary

CVE-2026-4372 is a high-severity Missing Serialization Control Element (CWE-1066) vulnerability in Huggingface Transformers. Its CVSS base score is 7.8 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Application or System Exploitation (T1499.004); ranked at the 43th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

This vulnerability is AI-related — categorised as NLP and Transformers; in the Supply Chain and Deployment risk domain.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

AI Security AnalysisAI

AI Category
NLP and Transformers
Risk Domain
Supply Chain and Deployment
OWASP Top 10 for LLMs 2025
None mapped
Classification Reason
Matched keywords: huggingface, transformers

Related Threats

MITRE ATT&CK Enterprise Techniques

MITRE ATT&CK v20.0

T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1203 Exploitation for Client Execution Execution
Adversaries may exploit software vulnerabilities in client applications to execute code.
T1210 Exploitation of Remote Services Lateral Movement
Adversaries may exploit remote services to gain unauthorized access to internal systems once inside of a network.
T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
T1499 Endpoint Denial of Service Impact
Adversaries may perform Endpoint Denial of Service (DoS) attacks to degrade or block the availability of services to users.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2024-11392Same product: Huggingface Transformers
CVE-2026-1839Same product: Huggingface Transformers
CVE-2024-11393Same product: Huggingface Transformers
CVE-2025-14930Same product: Huggingface Transformers
CVE-2025-14921Same product: Huggingface Transformers
CVE-2024-3568Same product: Huggingface Transformers
CVE-2025-14929Same product: Huggingface Transformers
CVE-2024-11394Same product: Huggingface Transformers
CVE-2025-14920Same product: Huggingface Transformers
CVE-2025-14924Same product: Huggingface Transformers

Affected Assets

huggingface
transformers
≤ 5.3.0

Mitigating Controls

Mitigating Controls (NIST 800-53 r5)

Our mappings, made for this CVE.

Developer testing and evaluation can discover missing serialization methods through code analysis or test cases exercising serializable elements.

Input validation directly stops deserialization of untrusted data by ensuring inputs are valid before processing.

Requiring a documented development process and standards enforces consistent implementation of serialization controls for data elements.

Security engineering principles require explicit handling of data representation and transformation, directly stopping omission of serialization methods.

Integrity verification tools can detect malformed or tampered serialized data after the fact.

Mitigating Controls (NIST CSF 2.0)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→CSF cross-walk — links open the control.

PR.PS-06 mostly match
blocks

Secure SDLC practices directly require proper serialization methods for serializable elements.

Mitigating Controls (ISO/IEC 27001:2022 Annex A)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→ISO cross-walk — links open the control.

finds

Security testing can detect missing serialization methods before production deployment.

prevents

Training technical teams on secure deserialization practices reduces a minority of CWE-502 instances, but developers remain fallible and the owner explicitly identified A.8.29 (security testing) as the strongest control for this weakness, with A.8.28 (secure coding) graded only `partial` on the same pair.

prevents

Secure coding standards directly address implementing required serialization methods for data elements.

prevents

A.8.30 carries its effect through the secure-development practices its contract requires of the supplier (8.25 to 8.29), so it reduces ordinary software implementation weaknesses like a missing serialization method at `partial`; the clause's ceiling on this verb is `partial` because it depends on those other controls being implemented.

finds

Regular scanning of third-party libraries and timely patching reduce the likelihood that unsafe deserialization vulnerabilities remain active.

References