Treat bash >& file redirects as file mutations in auto mode - #905
Merged
TheGreatAxios merged 1 commit intoSep 11, 2026
Merged
Conversation
Bash combined redirects write a file the same way a plain redirect does. The matcher skipped every form that started with >& so it would not flag fd dups, and those writes auto-allowed. Classify >& to a non-fd, non-safe-sink path as a file mutation and leave fd dups unmatched.
TheGreatAxios
commented
Sep 11, 2026
TheGreatAxios
left a comment
Collaborator
Author
There was a problem hiding this comment.
Looks good to merge. The new >& word matcher treats bash combined redirects as file mutations while leaving 2>&1 / n>&- and safe /dev/* sinks unmatched — same shape as the existing > / >> rule. Regression cases cover spaced and unspaced forms plus the fd-dup non-deny. CI is green.
TheGreatAxios
deleted the
cl-7633-treat-bash-file-redirects-as-file-mutations-in-auto-mode
branch
September 11, 2026 05:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-mode shell policy now classifies
>& pathandn>& path(non-fd, non-/dev-sink targets) as file-mutation deny, same as>/>>. fd-dups (2>&1) still skip the rule.Verification: classify-security + auto-shell-policy suites 108 pass; lint + build pass; typecheck/full-suite gaps pre-existing and environmental (vendor semver, git-env timeouts).
Fixes CL-7633