HuggingFace transformers vulnerable to remote code execution
CVE-2026-4372 · GHSA-29pf-2h5f-8g72 · published 2026-05-26 · updated 2026-07-01
- Severity
- High
- CVSS score
- 7.8
- Chance of exploitation (EPSS)
- 0.70%
- Fixed in
- 5.3.0
- Exploitation No known exploitation
- Automatable No
- Technical impact Total
- CISA SSVC
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. …
Upgrade transformers to 5.3.0 or later.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| transformers | PyPI | < 5.3.0 | 5.3.0 |
- CriticalLMDeploy has Remote Code Execution by Pickle Deserialization via handle_zmq_recv in lmdeploy/lmdeploy/pytorch/disagg/conn/engine_conn.pylmdeploy
- CriticalLMdeploy has Remote Code Execution by Pickle Deserialization via zmq_rpc.call_and_response() in InterLM/lmdeploylmdeploy
- CriticalSGLang: Unauthenticated RCE via --enable-custom-logit-processorsglang
- CriticalSGLanG: Multimodal scheduler deserializes untrusted pickle data on 0.0.0.0 ROUTER socketsglang
- Criticaln8n: HTTP Request Node Pagination Prototype Pollution to RCEn8n, n8n, n8n
- Criticaln8n Has an XML Node Prototype Pollution Patch Bypassn8n, n8n, n8n
- Criticaltransformers has a Deserialization of Untrusted Data vulnerabilitytransformers
- HighHugging Face Transformers downloads custom generation code before trust consenttransformers
- HighTransformers save_pretrained path traversal allows arbitrary file writes through chat template namestransformers
- Highhuggingface/transformers: Arbitrary Code Execution During Model Initialization in the LightGlue Model Loading Pathtransformers
- HighDeserialization of Untrusted Data in Hugging Face Transformerstransformers
- HighDeserialization of Untrusted Data in Hugging Face Transformerstransformers
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.