Skip to content

Conversation

@RinZ27
Copy link

@RinZ27 RinZ27 commented Jan 5, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

The following comment was made by an LLM, it may be inaccurate:

Duplicate PR Search Results

No duplicate PRs found.

The search results only returned the PR itself (PR #6948), which is expected. Additional searches for related security and validation terms yielded no other open PRs addressing:

  • BashTool security hardening
  • Command injection prevention
  • Shell syntax validation

Conclusion: This PR appears to be unique and is not duplicating any existing open pull requests in the repository.

@RinZ27 RinZ27 force-pushed the security/harden-bash-exec branch 3 times, most recently from 09e4a65 to c6e3a8c Compare January 9, 2026 12:58
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Hey! Your PR title Hardening BashTool input validation doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@RinZ27 RinZ27 changed the title Hardening BashTool input validation feat: Harden BashTool input validation Jan 9, 2026
@RinZ27 RinZ27 changed the title feat: Harden BashTool input validation feat: update BashTool command parsing logic Jan 9, 2026
@RinZ27 RinZ27 force-pushed the security/harden-bash-exec branch from 45e430a to 3471140 Compare January 10, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An agent is able to read all filesystem outside a project directory in Plan mode BashTool input validation security hardening

1 participant