Vulnerability · Published Mar 27, 2026 · Assigned by GitHub_M
CVE-2026-33718OpenHands is Vulnerable to Command Injection through its Git Diff Handler
High 7.6
In plain English
A high-severity OS command injection in OpenHands from OpenHands. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.0% (higher than 81% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | openhands-ai | 1.5.0 | GHSA-7h8w-hj9j-8rjw |
| PyPI | openhands-ai | 1.5.0 | PYSEC-2026-106 |
Affected products (as reported)
Weakness: CWE-78 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
References
- https://github.com/OpenHands/OpenHands/security/advisories/GHSA-7h8w-hj9j-8rjw x_refsource_CONFIRM
- https://github.com/OpenHands/OpenHands/pull/13051 x_refsource_MISC
- https://docs.python.org/3/library/shlex.html#shlex.quote x_refsource_MISC
- https://docs.python.org/3/library/subprocess.html#security-considerations x_refsource_MISC
- https://owasp.org/www-community/attacks/Command_Injection x_refsource_MISC