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

Published May 24, 2026
·
Updated

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 attnimplementationinternal field set to an attacker-controlled HuggingFace Hub repository ID. When a victim loads this model using the standard AutoModelForCausalLM.frompretrained() 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 trustremotecode 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.

Affected Software

2 affected components
pypi/transformers<5.3.0
huggingface transformers<5.3.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade huggingface/transformers to a version that resolves this vulnerability.

    Fixed in 5.3.0

Event History

May 24, 2026
CVE Published
via MITRE·01:40 PM
Data Sourced
via MITRE·01:40 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-4372?

CVE-2026-4372 has a high severity score of 7.8.

2

What impact does CVE-2026-4372 have on users?

CVE-2026-4372 allows for arbitrary remote code execution, potentially compromising users' systems.

3

How do I fix CVE-2026-4372?

To fix CVE-2026-4372, upgrade the HuggingFace transformers library to version 5.3.0 or later.

4

Which versions are affected by CVE-2026-4372?

All versions of the HuggingFace transformers library prior to version 5.3.0 are affected by CVE-2026-4372.

5

What type of vulnerability is CVE-2026-4372?

CVE-2026-4372 is classified as a remote code execution vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203