CVE-2026-33718
published 2026-03-27CVE-2026-33718: 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…
PriorityP273critical9.9CVSS 3.1
AVNACLPRLUINSCCHIHAH
EPSS
1.89%
77.0th percentile
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.
Affected
2 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| openhands | openhands | < 1.5.0 | 1.5.0 |
| openhands | openhands | >= 0 < 1.5.0 | 1.5.0 |
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
OpenHands is Vulnerable to Command Injection through its Git Diff Handler
osv·2026-03-25
CVE-2026-33718 [HIGH] OpenHands is Vulnerable to Command Injection through its Git Diff Handler
OpenHands is Vulnerable to Command Injection through its Git Diff Handler
## Summary
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.
---
## Details
### Vulnerable Code Path
The vulnerability flows through these files:
1. **API Endpoint** (`openhands/server/routes/files.py:267-277`)
```python
@app.get('/git/diff')
async def git_diff(
path: str, # dict[str, str]:
self.git_handler.set_cwd(cwd
GHSA
OpenHands is Vulnerable to Command Injection through its Git Diff Handler
ghsa·2026-03-25
CVE-2026-33718 [HIGH] CWE-78 OpenHands is Vulnerable to Command Injection through its Git Diff Handler
OpenHands is Vulnerable to Command Injection through its Git Diff Handler
## Summary
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.
---
## Details
### Vulnerable Code Path
The vulnerability flows through these files:
1. **API Endpoint** (`openhands/server/routes/files.py:267-277`)
```python
@app.get('/git/diff')
async def git_diff(
path: str, # dict[str, str]:
self.git_handler.set_cwd(cwd
No detection rules found.
No public exploits indexed.
https://docs.python.org/3/library/shlex.html#shlex.quotehttps://docs.python.org/3/library/subprocess.html#security-considerationshttps://github.com/OpenHands/OpenHands/pull/13051https://github.com/OpenHands/OpenHands/security/advisories/GHSA-7h8w-hj9j-8rjwhttps://owasp.org/www-community/attacks/Command_Injection
2026-03-27
Published