OpenHands is Vulnerable to Command Injection through its Git Diff Handler
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-78.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| OpenHands | OpenHands | before 1.5.0 | 1.5.0 | Patch available | CNA |
| — | openhands-ai (PyPI) | before 1.5.0 | 1.5.0 | Patch available | GHSA-7h8w-hj9j-8rjw |
- OpenHands VendorOpenHands Affected before 1.5.0 Fixed in 1.5.0 Patch available CNA
- openhands-ai (PyPI) Vendor— Affected before 1.5.0 Fixed in 1.5.0 Patch available GHSA-7h8w-hj9j-8rjw
Remediation
- Fix · CNA OpenHands (OpenHands) Fixed in 1.5.0
- Fix · GHSA-7h8w-hj9j-8rjw openhands-ai (PyPI) Fixed in 1.5.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-33718
- 2026-10-03 Alias added: GHSA-7h8w-hj9j-8rjw
References
Other 5
- https://docs.python.org/3/library/shlex.html#shlex.quote
- https://docs.python.org/3/library/subprocess.html#security-considerations
- https://owasp.org/www-community/attacks/Command_Injection
- https://github.com/OpenHands/OpenHands
- https://github.com/pypa/advisory-database/tree/main/vulns/openhands-ai/PYSEC-2026-106.yaml
Sources
- CVE-2026-33718 · CVE Program
- CVE-2026-33718 · NVD
- FIRST EPSS
- GHSA-7h8w-hj9j-8rjw · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences