CVE-2025-14924: transformers: Deserialization enables RCE
UNKNOWNAny team loading Megatron-GPT2 checkpoints via Hugging Face Transformers is exposed to arbitrary code execution at model-load time — patch or restrict checkpoint ingestion immediately. The real danger is not direct attacks but poisoned model files distributed via Hugging Face Hub, internal model registries, or third-party model repositories that your ML pipelines load automatically. Audit all automated checkpoint-loading workflows and enforce allowlists of trusted model sources before resuming normal operations.
What is the risk?
Effective severity is HIGH despite the N/A CVSS. Deserialization RCE in a Python ML library (almost certainly pickle-based) is trivially exploitable once a malicious checkpoint is in the loading path — exploitation requires no authentication, no privileges, and only user-level interaction (opening a file or visiting a page that triggers a download). The blast radius is significant: ML training and inference processes typically run with broad filesystem and network access, making post-exploitation lateral movement straightforward. Exposure is wide given Transformers is the dominant ML framework and Megatron-GPT2 is used in large-scale LLM training pipelines at enterprise scale.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Transformers | pip | — | No patch |
Do you use Transformers? You're affected.
How severe is it?
What should I do?
6 steps-
PATCH
Upgrade Hugging Face Transformers to the patched version as soon as ZDI-25-1141 discloses the fixed release. Monitor the Transformers GitHub releases page.
-
RESTRICT
Block loading of checkpoints from unverified sources in all automated pipelines; implement SHA-256 hash verification of checkpoint files against a trusted manifest before deserialization.
-
SANDBOX
Run checkpoint loading in isolated environments (containers with no network egress, restricted filesystem mounts) to limit post-exploit blast radius.
-
AUDIT
Review all pipeline code that calls megatron_gpt2 loading functions; grep for
torch.load,pickle.load, and equivalent calls withoutweights_only=True. -
DETECT
Alert on unexpected outbound network connections or filesystem writes originating from training/inference processes; these are canary indicators of post-exploit activity.
-
POLICY
Enforce a model provenance policy — only load checkpoints from internal registries with signed provenance records.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-14924?
Any team loading Megatron-GPT2 checkpoints via Hugging Face Transformers is exposed to arbitrary code execution at model-load time — patch or restrict checkpoint ingestion immediately. The real danger is not direct attacks but poisoned model files distributed via Hugging Face Hub, internal model registries, or third-party model repositories that your ML pipelines load automatically. Audit all automated checkpoint-loading workflows and enforce allowlists of trusted model sources before resuming normal operations.
Is CVE-2025-14924 actively exploited?
No confirmed active exploitation of CVE-2025-14924 has been reported, but organizations should still patch proactively.
How to fix CVE-2025-14924?
1. PATCH: Upgrade Hugging Face Transformers to the patched version as soon as ZDI-25-1141 discloses the fixed release. Monitor the Transformers GitHub releases page. 2. RESTRICT: Block loading of checkpoints from unverified sources in all automated pipelines; implement SHA-256 hash verification of checkpoint files against a trusted manifest before deserialization. 3. SANDBOX: Run checkpoint loading in isolated environments (containers with no network egress, restricted filesystem mounts) to limit post-exploit blast radius. 4. AUDIT: Review all pipeline code that calls megatron_gpt2 loading functions; grep for `torch.load`, `pickle.load`, and equivalent calls without `weights_only=True`. 5. DETECT: Alert on unexpected outbound network connections or filesystem writes originating from training/inference processes; these are canary indicators of post-exploit activity. 6. POLICY: Enforce a model provenance policy — only load checkpoints from internal registries with signed provenance records.
What systems are affected by CVE-2025-14924?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, MLOps pipelines, model registries, research and experimentation environments.
What is the CVSS score for CVE-2025-14924?
No CVSS score has been assigned yet.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.003 Model AML.T0011.000 Unsafe AI Artifacts AML.T0018.002 Embed Malware AML.T0058 Publish Poisoned Models AML.T0078 Drive-by Compromise AML.T0079 Stage Capabilities Compliance Controls Affected
What are the technical details?
Original Advisory
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.
Exploitation Scenario
An adversary publishes a seemingly legitimate Megatron-GPT2 fine-tuned checkpoint to Hugging Face Hub, embedding a malicious pickle payload in the checkpoint file. They promote it via AI community forums or social media targeting ML engineers. A data scientist at a target organization downloads and loads the checkpoint using the standard Transformers API. The deserialization step triggers the embedded payload, executing a reverse shell or credential-harvesting script in the context of the training process — which typically runs with broad permissions on GPU infrastructure. Alternatively, an attacker who has compromised a model registry or S3 bucket used by an automated MLOps pipeline can inject the malicious checkpoint, achieving RCE without any direct user interaction beyond the pipeline's normal execution.
Weaknesses (CWE)
CWE-502 — Deserialization of Untrusted Data: The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
- [Architecture and Design, Implementation] If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
- [Implementation] When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
Source: MITRE CWE corpus.
References
Timeline
Related Vulnerabilities
CVE-2026-26210 9.8 KTransformers: pickle RCE via unauthenticated ZMQ socket
Same package: transformers CVE-2024-3568 9.6 HuggingFace Transformers: RCE via pickle deserialization
Same package: transformers CVE-2026-5241 9.6 transformers: trust_remote_code bypass enables RCE via model load
Same package: transformers CVE-2024-11393 8.8 Transformers: RCE via MaskFormer model deserialization
Same package: transformers CVE-2023-6730 8.8 HuggingFace Transformers: RCE via unsafe deserialization
Same package: transformers