Remote Code Execution Vulnerability in HuggingFace Transformers Library
CVE-2026-4372
7.8HIGH
What is CVE-2026-4372?
A remote code execution flaw exists in the HuggingFace Transformers library, impacting all versions before 5.3.0. This vulnerability allows attackers to create a malicious config.json that directs the library to download a harmful repository. Upon execution via the AutoModelForCausalLM.from_pretrained() API, arbitrary Python code is run with the victim's OS privileges. The issue stems from poor deserialization practices, lack of proper field sanitization, and inadequate security measures, leading to exploitation via documented usage patterns, rendering it particularly dangerous. Users are strongly recommended to upgrade to version 5.3.0 or above to prevent exploitation.
Affected Version(s)
huggingface/transformers < 5.3.0
