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

- Severity: High 7.6 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.19%, higher than 82% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-03-25T21:54:55.000Z
- Modified: 2026-06-17T10:37:58.863Z
- Also known as: GHSA-7h8w-hj9j-8rjw, PYSEC-2026-106
- Weaknesses: CWE-78
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- OpenHands OpenHands: < 1.5.0; before 1.5.0
- openhands-ai (PyPI): before 1.5.0

## Every score

- GitHub_M: CVSS:3.1 7.6 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L`
- GitHub: CVSS:3.1 7.6 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L`
- NVD: CVSS:3.1 9.9 Critical `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 9.9 Critical `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`

## References

- <https://github.com/OpenHands/OpenHands/security/advisories/GHSA-7h8w-hj9j-8rjw> (exploit, evidence, mitigation, vendor-advisory, web)
- <https://github.com/OpenHands/OpenHands/pull/13051> (fix, issue-tracking, patch, web)
- <https://docs.python.org/3/library/shlex.html#shlex.quote> (article, technical-description, web)
- <https://docs.python.org/3/library/subprocess.html#security-considerations> (article, technical-description, web)
- <https://owasp.org/www-community/attacks/Command_Injection> (article, technical-description, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-33718> (advisory)
- <https://github.com/OpenHands/OpenHands> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/openhands-ai/PYSEC-2026-106.yaml> (web)

## Sources

- CVE List: [CVE-2026-33718](https://www.cve.org/CVERecord?id=CVE-2026-33718), CVE Terms of Use, modified 2026-03-27
- GitHub Advisory Database: [GHSA-7h8w-hj9j-8rjw](https://github.com/advisories/GHSA-7h8w-hj9j-8rjw), CC-BY-4.0, modified 2026-06-08
- NVD: [CVE-2026-33718](https://nvd.nist.gov/vuln/detail/CVE-2026-33718), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-106](https://osv.dev/vulnerability/PYSEC-2026-106), CC-BY-4.0, modified 2026-05-20

---

Page: https://cve.day/CVE-2026-33718 · Whole record: https://cve.day/CVE-2026-33718.json · Rebuilt by cve.day 2026-11-25T22:59:17.354Z
