[PR #6948] feat: update BashTool command parsing logic #12171

Open
opened 2026-02-16 18:17:06 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6948

State: open
Merged: No


Refined the command parsing logic in BashTool by adding a check for empty command arrays during tree-sitter traversal. This prevent processing malformed shell structures that could lead to unexpected execution behavior.

Security Risk: Potential for command injection or agent escape if malformed input nodes are processed without validation.

Fixes #7478
Fixes #7504

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6948 **State:** open **Merged:** No --- Refined the command parsing logic in BashTool by adding a check for empty command arrays during tree-sitter traversal. This prevent processing malformed shell structures that could lead to unexpected execution behavior. Security Risk: Potential for command injection or agent escape if malformed input nodes are processed without validation. Fixes #7478 Fixes #7504
yindo added the pull-request label 2026-02-16 18:17:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12171