CVE-2024-3568: PYSEC-2026-1978 - Transformers Deserialization of Untrusted Data vulnerability

CVE-2024-3568 · Severity: low · CVSS 3 · Published 2026-07-07

Hugging Face Transformers is a popular machine learning library used to load and work with pre-trained AI models. The library contains a vulnerability in how it loads checkpoint files, which could allow an attacker to execute arbitrary code on a user's system by providing a malicious checkpoint file. An attacker could trick a developer or researcher into loading a crafted checkpoint file, potentially compromising their machine and sensitive model data.

Technologies: Hugging Face Transformers, transformers (PyPI). Vendors: Hugging Face, PyPI.

Quick answers

Is CVE-2024-3568 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2024-3568 being exploited in the wild.
How severe is CVE-2024-3568?
Low severity, with a CVSS score of 3, published 7 July 2026.
Which products and versions are affected?
Hugging Face Transformers before 4.38.0; transformers (PyPI) ECOSYSTEM:introduced=0,fixed=4.38.0.
Is there a fix for CVE-2024-3568?
Yes. transformers (PyPI): upgrade to 4.38.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2024-3568 attacked?
It is attacked over the network.
Am I affected by CVE-2024-3568?
Check whether you run Hugging Face Transformers or transformers (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • transformers (PyPI): upgrade to 4.38.0 or later
    pip install "transformers>=4.38.0"

Technical details

The vulnerability exists in the load_repo_checkpoint() function of the TFPreTrainedModel class, which uses pickle.load() to deserialize data from potentially untrusted checkpoint sources without proper validation. This is a classic deserialization vulnerability (CWE-502) where attackers can craft malicious pickle-serialized payloads to achieve arbitrary code execution. The attack vector is network-based with high complexity (requires user interaction to load the malicious checkpoint), and exploits an unprompted trust in checkpoint data during normal model loading workflows. An authenticated attacker or social engineering attack is required to deliver the payload. The vulnerability was patched in version 4.38.0 and affects all versions prior to this release.

Affected products

  • Hugging Face Transformers before 4.38.0

Identifiers

  • CVE-2024-3568
  • GHSA-37q5-v5qm-c9v8
  • PYSEC-2026-1978

Timeline

  • 2024-04-10: disclosed
  • 2024-04-10: patched: Fixed in version 4.38.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.