Deserialization in Huggingface Huggingface/transformers

CVE-2024-3568

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.

Vulnerability class: Insecure Deserialization

Published · last modified .

CVSS v3 metric

CVSS v3 base score 9.6 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.

EPSS exploit prediction

EPSS 0.021, 81.9th percentile (scored ); unchanged over 30 days. About EPSS.

Affected products

Weakness classification (CWE)

Public exploits and proof-of-concept code

1 public repository with exploit or proof-of-concept code for this CVE:

  • rooobeam/Pickle-Deserialization-Exploit-in-Transformers (last pushed 2025-07-10): 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…

Also mentioned in 6 other repositories (fkie-cad/nvd-json-data-feeds, J1ezds/Vulnerability-Wiki-page, llm-sec/transformer-hacker, …). These reference the CVE in a list, notes or a scanner and are not exploit code for it.

References