[ ezo labs // research ]

OpenHands 1.5.0 still executes the branch name its own fix left unquoted

CVE-2026-33718’s fix quoted the caller’s path and the git show argument. The repository’s own branch name is still interpolated into a shell=True command in the same handler, on the version the…

contentsSummary
  1. Summary
  2. The gap
  3. Reproduction
  4. Impact
  5. Affected versions
  6. Fix status
  7. The vendor’s record
  8. Timeline
  9. References
  10. Disclosure

abstract

OpenHands’ Git diff handler builds shell strings. The fix for CVE-2026-33718 (GHSA-7h8w-hj9j-8rjw) quoted the caller’s path at git_handler.py:141 and the ref:path argument of git show in the new `_make_git_show_cmd`, and it left `git --no-pager rev-parse --verify {ref}` at git_diff.py:76 interpolated with shell=True. `ref` is `origin/<current branch>`, and git permits `;`, `"`, `>` and `#` in a ref name. We executed the released 1.5.0 sdist, the version the advisory calls patched, and 1.6.0: a branch named `main;id>"/tmp/oh-branch-marker";#` writes its marker while `get_git_diff()` returns a normal diff and `get_git_changes()` a normal change list. A clean branch and the advisory’s own path payload produce no marker. The handler is gone from 1.7.0, removed with the V0 runtime; the input ends there by removal, not by a quoting change.

Summary

The published advisory names 1.5.0 as the patched release. On 1.5.0, the branch name the same handler reads is still a shell fragment.

The gap

The repository’s own branch name is interpolated into a shell=True command, so a branch named main;id>"/tmp/x";# executes a second command while get_git_diff() returns a normal diff.

  • openhands/runtime/utils/git_diff.py:49-50, 76: get_valid_ref() reads the repository’s branch name and interpolates f'origin/{current_branch}' into run(f'git --no-pager rev-parse --verify {ref}', repo_dir).
  • openhands/runtime/utils/git_diff.py:35: run() is subprocess.run(args=cmd, shell=True).
  • openhands/runtime/utils/git_changes.py:36-37, 63, 81: The sibling script repeats the same interpolation and shell=True pattern.
  • openhands/runtime/utils/git_handler.py:141: The 1.5.0 fix quotes the caller’s path here and the ref:path argument at git_diff.py:85-87; it does not touch git_changes.py or the branch interpolation at git_diff.py:76.

Reproduction

The PyPI sdists were loaded verbatim (1.5.0 sha256 f056b253…, 1.6.0 sha256 883a5bc5…); GitHandler and the scripts were run with the runtime’s subprocess.run(args=cmd, shell=True); a git wrapper logged the argv git received.

With branch main;id>"/tmp/oh-branch-marker";#, get_git_diff('victim.txt') returns the normal two-line diff, exit 0, and writes the marker (sha256 6e03bce1…). The same branch through get_git_changes() returns [{"status":"M","path":"victim.txt"}] and writes the marker. 1.6.0 behaves identically; its three handler files are byte-identical to 1.5.0’s.

Impact

A repository whose branch name contains shell metacharacters executes a command of the branch author’s choosing in the OpenHands runtime when a diff or change list is requested. The caller sees a normal diff; the second command runs silently.

Affected versions

openhands-ai 1.5.0 and 1.6.0 ship the advisory’s named fix, and they are the two we executed; every earlier release that carries the same legacy runtime is affected too, and the unquoted interpolation is present in the 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0 and 1.4.0 trees we read. 1.7.0 and later do not contain the handler. The advisory’s published range (affected <= 1.4.0 / patched 1.5.0) does not describe this input.

Fix status

Quote the ref at git_diff.py:76 and git_changes.py:63, or build the argv as a list and drop shell=True. The published 1.5.0 fix did not do this. No release quotes the branch name; 1.7.0 ends the input by deleting the handler.

The vendor’s record

No vendor reply since the advisory was filed on 2026-10-30. The published GHSA-7h8w-hj9j-8rjw is the authority for the class; the finding is the same handler’s other shell input, which the fix’s own remediation note (“proper argument array handling or rigorous path sanitization … to prevent command chaining”) covers.

Timeline

  • 2026-10-30T18:51:38Z: Private report filed (GHSA-wpxp-rv65-2h3j)
  • 2026-11-11T20:36:07Z: Publication ask posted (comment 369525)
  • 2026-11-11T23:21:37Z: Class-anchored follow-up posted (comment 369706)
  • 2026-11-12: Notice naming 2026-11-17T16:00Z as the planned publication
  • 2026-11-24T06:36:19Z: This write-up published
  • 2026-11-24: MITRE CNA-LR request submitted

References

Disclosure

This note is an independent write-up. It is published on 2026-11-24 as the public reference for a CVE request. The private advisory and this write-up describe the same defect; the vendor advisory named above is the authority where one exists.

revisionsfirst published , last updated
revisions to this post
datechange
First publication.

cite this

EZO Labs Security. OpenHands 1.5.0 still executes the branch name its own fix left unquoted. EZO Labs Inc, research report EZO-R-2026-13, 24 November 2026. https://ezolabs.net/research/openhands-branch-name-command-injection

@techreport{openhandsbranchnamecommandinjection,
  title       = {OpenHands 1.5.0 still executes the branch name its own fix left unquoted},
  author      = {{EZO Labs Security}},
  institution = {EZO Labs Inc},
  type        = {Research report},
  number      = {EZO-R-2026-13},
  year        = {2026},
  month       = nov,
  url         = {https://ezolabs.net/research/openhands-branch-name-command-injection}
}

licensed under CC BY 4.0.

authors

next

  1. The Relay Trap

    Trying to keep pace with your AI agents is a loop you cannot win. The fix is not reviewing faster; it is changing what reaches you.

all research