You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Redirect-only bash statements bypass all permission rules ("> out.txt" runs under "bash": {"*": "deny"}) #52180
No prompt is shown either — the call never reaches the permission layer.
> out.txt creates or truncates the file, >> appends.
"*>*": "deny" is what makes row 2 safe, and it is the only thing that does. It
provably cannot help the rest: the redirect-only statements are never matched
against any pattern, so there is nothing for a pattern to catch. Neither can ">*" or any other pattern — the value being matched does not exist.
Without a redirect deny, row 2 also executes; that was #5330, fixed by #6737.
The statements above are the residual case that fix does not cover.
A bare redirection parses as a redirected_statement containing only a file_redirect — there is no command node. The loop body never runs, patterns
stays empty, and no permission check is issued. The command.length guard causes
the same skip for any command node that yields no tokens.
This is the residual case of #5330: the fix in #6737 (commit e7ff7143) attaches
the redirect text via node.parent.text, but only for statements that already
contain a command node. The same commit also introduced the env-prefix bypass in #16075, so the string handling around here looks worth revisiting.
Activity
github-actions commentedon Sep 29, 2026
This issue might be a duplicate of existing issues. Please check:
If possible, please also add the OpenCode version and OS/shell used to help confirm whether this varies by environment.
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊