Skip to content
OpenAdvisories
High · 7.8 CVE-2025-14924 EUVD-2025-204821GHSA-mc28-fv57-23xpPYSEC-2025-213

Hugging Face Transformers megatron_gpt2 Deserialization of Untrusted Data Remote Code Execution Vulnerability

Published Dec 23, 2025 · Updated Dec 26, 2025 · Assigned by zdi

Description

Hugging Face Transformers megatron_gpt2 Deserialization of Untrusted Data Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Hugging Face Transformers. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.

The specific flaw exists within the parsing of checkpoints. The issue results from the lack of proper validation of user-supplied data, which can result in deserialization of untrusted data. An attacker can leverage this vulnerability to execute code in the context of the current process. Was ZDI-CAN-27984.

Affected products

VendorProductAffectedFixed
Hugging Face Transformers 95faabf0a6cd845f4c5548697e288a79e424b096 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI transformers <= 4.55.0 — PYSEC-2025-213

References