Uh oh!
There was an error while loading. Please reload this page.
fix(security): require explicit approval for shell redirection/background in command auto-approve - #11367
fix(security): require explicit approval for shell redirection/background in command auto-approve#113670xMink wants to merge 2 commits into
Conversation
All issues from previous reviews have been addressed. Quote-aware operator detection via
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Uh oh!
There was an error while loading. Please reload this page.
4c99f4f to
cf5084fComparecf5084f to
2ab6380Compare0xMink
commented
Feb 10, 2026
Addressed the review feedback:
|
0xMink
commented
Feb 10, 2026
@roomote Could you please re-review? I addressed your <&N note, and also tightened fd-to-fd stripping with a token-boundary lookahead to avoid false negatives like >&2file / <&3in. Tests expanded from 44 to 55 and I force-pushed the update. Thanks. |
ghost
commented
Feb 10, 2026
No outstanding issues to fix. The reviewer has confirmed all previous issues are addressed, and all 55 tests pass locally. |
…ound in command auto-approve Commands containing file redirection (<, >, >>, <<) or standalone background operators (&) now force explicit user approval instead of being auto-approved via prefix matching. Safe fd-to-fd redirections (2>&1, >&2) remain auto-approvable. Also tightens the pre-existing fd-to-fd stripping regex with a token-boundary lookahead to prevent false negatives like >&2file and <&3in being silently stripped as fd-to-fd. Adds the first dedicated test suite for the command auto-approval pipeline (55 tests).
2ab6380 to
0d2a949Compare0xMink
commented
Feb 11, 2026
Verified the latest state of the PR. The reviewer confirmed all previous issues are resolved and no new issues were found. All 79 tests pass locally. No code changes needed. |
hannesrudolph
commented
Feb 20, 2026
Closing: PR lacks clear evidence of manual testing. |
robertjmcintyre
commented
Feb 20, 2026
@0xMink - I think that this is a fairly important issue, especially as people get more and more comfortable with giving Roo increasing autonomy. Is it possible to get this reactivated and committed? |
Refs #11095
Summary
shell: true. For example, auto-approvinggit showwould also auto-approvegit show > out.txt, allowing writes to an arbitrary file.<,>,>>,<<, etc.) now require explicit approval (ask_user).2>&1,>&2,<&3,0<&4).&) now require explicit approval.(?=$|\s|[;&|()<>])to avoid false negatives such as>&2fileand<&3in, where the redirection target is a word and therefore represents file redirection, not fd-to-fd duplication.Test plan
containsShellFileRedirection()— 21 cases: detects output/input/append/here-doc/stderr/mixed redirections (9), excludes safe fd-to-fd like2>&1,>&2,<&3,0<&4(5), token-boundary edge cases —>&2file,<&3in,2>&1&&,2>&1>out.txt,0<&4|(5), general sanity checks (2)containsBackgroundOperator()— 8 cases: detects standalone&, excludes&&,&>,>&,<&getCommandDecision()— 15 integration cases: redirection forcesask_user, fd-to-fd preservesauto_approve, background forcesask_user, token-boundary edge cases, denylist regressioncontainsDangerousSubstitution,findLongestPrefixMatch,getSingleCommandDecision— 11 cases