Skip to content
OpenAdvisories
Low · 3.4 Public exploit CVE-2024-3568 EUVD-2024-1077GHSA-37q5-v5qm-c9v8PYSEC-2026-1978

Arbitrary Code Execution via Deserialization in huggingface/transformers

Published Apr 10, 2024 · Updated Aug 1, 2024 · Assigned by @huntr_ai

Description

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data within the `load_repo_checkpoint()` function of the `TFPreTrainedModel()` class. Attackers can execute arbitrary code and commands by crafting a malicious serialized payload, exploiting the use of `pickle.load()` on data from potentially untrusted sources. This vulnerability allows for remote code execution (RCE) by deceiving victims into loading a seemingly harmless checkpoint during a normal training process, thereby enabling attackers to execute arbitrary code on the targeted machine.

Affected products

VendorProductAffectedFixed
huggingface huggingface/transformers unspecified – < 4.38 4.38

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

  • This study analyzes Python pickle deserialization vulnerabilities, focusing on CVE-2024-3568 in Hugging Face Transformers' TFAutoModel. We reproduce the exploit to examine its root cause, attack vect…

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI transformers < 4.38.0 4.38.0 GHSA-37q5-v5qm-c9v8

References