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

Source: https://junglewise.ai/threats/cve-2024-3568-hugging-face-transformers-deserialization-of-untrusted-data  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-07. Updated: 2026-09-26  
License: CC BY 4.0 with a link back

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](https://junglewise.ai/threats/technologies/transformers), [transformers (PyPI)](https://junglewise.ai/threats/technologies/pypi-transformers). Vendors: [Hugging Face](https://junglewise.ai/threats/vendors/hugging-face), [PyPI](https://junglewise.ai/threats/vendors/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

  ```sh
  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

- [https://github.com/huggingface/transformers/commit/693667b8ac8138b83f8adb6522ddaf42fa07c125](https://github.com/huggingface/transformers/commit/693667b8ac8138b83f8adb6522ddaf42fa07c125)

## Related threats

- [Hugging Face Transformers arbitrary file write via load_custom_generate](https://junglewise.ai/threats/cve-2026-80047-hugging-face-transformers-arbitrary-file-write-via-load-custom)
- [Hugging Face Transformers path traversal in save_pretrained](https://junglewise.ai/threats/cve-2026-9856-hugging-face-transformers-path-traversal-in-save-pretrained)
- [Hugging Face Transformers vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer](https://junglewise.ai/threats/cve-2025-6921-hugging-face-transformers-vulnerable-to-regular-expression-denial)
- [PYSEC-2026-1988 - Hugging Face Transformers library has Regular Expression Denial of Service](https://junglewise.ai/threats/cve-2025-6051-hugging-face-transformers-library-has-regular-expression-denial-of)
- [PYSEC-2026-1981 - Hugging Face Transformers is vulnerable to ReDoS through its MarianTokenizer](https://junglewise.ai/threats/cve-2025-6638-hugging-face-transformers-is-vulnerable-to-redos-through-its)
