Repository navigation
fix(security): close the remaining command guard bypasses - #83
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
| return LEADING_OPERANDS.get(self.name, 0) | ||
| if any(self.dynamic[self.index : self.index + 1]): | ||
| raise UnsupportedSyntax("a chrt priority known only at run time requires explicit review", "wrapper") | ||
| return int(self.index < len(self.arguments) and self.arguments[self.index].isdigit()) |
There was a problem hiding this comment.
P2: The chrt priority is recognized only when str.isdigit() is true. util-linux parses the priority with strtos32_or_err, which uses strtoimax, so it also accepts forms like +0. In util-linux ≤ 2.39 the priority is required, so chrt -o +0 gh repo delete x --yes runs as an unprivileged user and executes gh repo delete.
Here leading_operands() returns 0 for that input. The unwrapped layer then becomes +0 gh repo delete x --yes with program +0, so the deny prefix never matches. The forbidden hook downgrades from deny to a provider prompt, and wrapped_ask_objection likewise misses ask prefixes behind it.
Possible fix: treat a leading +/- sign followed by digits (e.g. re.fullmatch(r"[+-]?\d+", …)) as the priority, or ask when the word after chrt's options isn't a plain program name. A regression case such as chrt -o +0 {DELETE} → deny would cover it.
Review summary (read-only)Blocking findings (P0/P1): 0
Other things I checked that look correct:
The new regression suite is thorough. I could not run tests in this environment (command approval was required). 🤖 Generated with Claude Code |
Judge the program behind script, taskset, chrt, flock, watch, and doas, and inspect more shells. Ask for an ask-prefix command that runs behind a wrapper or inside a shell script, since the provider's rules do not see through them. Widen the forbidden patterns to attached, bundled, and `--` forms, and read a git commit option's value as data so `-m "--no-verify"` is allowed. Closes #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Treat csh-family, fish, rc, and nu -c scripts as uninspectable, read script options in any position with the last command winning, ask for a watch string built at run time, apply ask prefixes behind the time keyword and negation, and read unquoted git commit option values and --trailer as data. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Inspect every script option of script and flock instead of the last one, and keep a BSD script command beside them; treat versioned shell names such as ksh93 like their base shell; apply ask prefixes to every call under time or negation, not only its first; and match -n bundled with an attached message, keeping an option's first word when its argument holds whitespace. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ext prose Parse every script option of script and flock as its own script so a heredoc cannot join two of them, and accept an abbreviated --command after the operand. Keep an option's first word of a whitespace-holding argument only when the source word starts with a dash, so find -name "-exec foo" is not read as an action. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ents correctly Skip chrt's priority only when it is a number, since some policies take none, and read script options only up to the first word that begins a BSD child command, so grep -c or python3 -c arguments are not taken as scripts. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…scanner Scan the options after script's and flock's operand with the wrapper's own option parser, so a bundled value such as -Tabc is no -c; skip a double dash after a wrapper's operands; ask for a chrt priority known only at run time; and keep an option's first word only when its letters run into a quote, so an escaped find text stays prose. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…dles at -S and -u Move the attached-value handling for `-nm"fix: x"` out of the generic whitespace placeholder, which misread quoted find text, into the git commit masking, and stop a short-option bundle at -S or -u, whose attached letters are a value, so `-Sm --no-verify` keeps its flag visible. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…watch -d's value Find the commit subcommand through wrappers and git's global options instead of looking for the words git and commit anywhere, so find -name commit -delete keeps its action visible, and let watch -d take the rest of its bundle as its optional value, so -dx is no -x. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
e1cc0bd to
06b425f
Compare
…after -- out of commit flags Accept a +N chrt priority, skip a second double dash when chrt has no priority, and mask every word after the double dash of a git commit as a path, so -notes.txt is no -n. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
1 similar comment
|
@codex review |
| if executable in WRAPPERS: | ||
| return wrapper_scripts(command, executable) | ||
| shell = shell_name(executable) | ||
| foreign = shell in FOREIGN_SHELLS or (shell not in SHELLS and SHELL_LOOKALIKE.fullmatch(shell) is not None) |
There was a problem hiding this comment.
P2: SHELL_LOOKALIKE ([a-z0-9_.-]*sh) matches every program name ending in sh. That includes ordinary .sh scripts (run.sh, lint_format.sh) and ssh. For a foreign shell, the -c check also accepts long options and matches any c in the word (foreign or not argument.startswith("--") together with "c" in argument). As a result, ./scripts/test.sh --check, ./install.sh --force, ./build.sh --clean and ssh -oConnectTimeout=5 host now raise UnsupportedSyntax in parse. Both the allowed and the forbidden hook then return ask. Before this PR, the allowed hook let these unwrapped, ungoverned commands through without a prompt. Every repo shell script called with a long option that contains a c now prompts the user.
The tests only cover lolsh --help and lolsh script.txt; none of them pass a c option to a *.sh script or to ssh. A possible fix: leave out names containing . and the name ssh, and/or match only a real -c / --command / --command= option instead of any word that contains c.
Review summaryBlocking findings (P0/P1): 0
Other areas I checked by reading the code, with no issues found:
Note: the PR body lists some findings as unaddressed, but the code already seems to fix them. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…ells Match only names without a file extension as shell lookalikes, exclude ssh, and take a foreign shell's -c only as a letter bundle or --command, so ./build.sh --clean runs without a prompt. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
| if command.dynamic[option + 1]: | ||
| raise UnsupportedSyntax("a shell wrapper running a computed script requires explicit review", "wrapper") | ||
| return arguments[option + 1] | ||
| return [arguments[option + 1]] |
There was a problem hiding this comment.
P1 — The -c script is taken from the word right after the -c option. But bash, dash and zsh read the command string from the first word that is not an option, not from the word after -c. So the hook inspects the wrong word in these cases:
bash -c -- 'gh repo delete x --yes'→ the hook parses--as the scriptsh -c -e 'gh pr merge 76 --merge'→ the hook parses-eas the script
In both cases the real script is never parsed. Because it contains spaces, the outer word is masked in command_words_text. So neither the deny rules nor the new ask check see gh. This code was here before this PR, but this PR rewrites shell_scripts to close shell bypasses, and this form is not covered or tested. Fix: after -c, skip any further option words and one --, then take the next word (or ask when an option word follows -c).
| FOREIGN_SHELLS = frozenset({"csh", "elvish", "es", "fish", "nu", "rc", "tcsh"}) | ||
| # Names ending in sh that may be a shell; a file extension (run.sh) or ssh is not one. | ||
| SHELL_LOOKALIKE = re.compile(r"(?!ssh$)[a-z0-9_-]*sh") | ||
| FOREIGN_COMMAND_OPTION = re.compile(r"-(-command|[A-Za-z]*c[A-Za-z]*)(=.*)?") |
There was a problem hiding this comment.
P2 — The foreign-shell check misses some ways these shells take a command:
pwshmatchesSHELL_LOOKALIKE. But its standard spelling-Commandhas no lowercasec, soFOREIGN_COMMAND_OPTIONdoes not match it.pwsh -Command 'gh repo delete x --yes'andpwsh -CommandWithArgs ...get[]and are allowed. The same goes forpwsh -e <base64>(EncodedCommand).- Nushell's long option is
--commands, which--commanddoes not fullmatch. - Stdin and heredoc input to a foreign shell is never checked.
echo 'gh repo delete x --yes' | fishandfish <<EOF ... EOFare allowed, because line 191 only reads stdin scripts forSHELLS.
Suggestion: match the option case-insensitively, add --commands and -e/-ec, and ask when a foreign shell reads its script from stdin.
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Review summaryI read the code but did not run it; I had no permission to run Python here. I left two new inline findings that are not in the PR's LANE-BLOCKED table:
I also checked the commit option-value masking, the new wrapper option scans ( Blocking findings: 1 (P1). 🤖 Generated with Claude Code |
bash, dash and zsh take the script from the first word after -c that is no option, past a double dash, so bash -c -- 'cmd' and sh -c -e 'cmd' no longer parse the option as the script. A valued shell option there asks. Refs #77 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
| "^git[[:space:]]+add([[:space:]]+-[^[:space:]]*)*[[:space:]]+(\\./?|-[A-Za-z]*A[A-Za-z]*|--all)([[:space:]]|$)", | ||
| "(^|[[:space:]])git[[:space:]]+add([[:space:]]+-[^[:space:]]*)*[[:space:]]+(\\./?|-[A-Za-z]*A[A-Za-z]*|--all)([[:space:]]|$)", | ||
| "^git[[:space:]]+commit([[:space:]].*)?[[:space:]]+(--no-verify|-[aeiopqsvz]*n[^[:space:]]*)([[:space:]]|$)", | ||
| "(^|[[:space:]])git[[:space:]]+commit([[:space:]].*)?[[:space:]]+(--no-verify|-[aeiopqsvz]*n[^[:space:]]*)([[:space:]]|$)", |
There was a problem hiding this comment.
P2 — An abbreviated long option still gets past the no-verify deny. Git's parse-options accepts any unique prefix of a long option, so git commit --no-verif -m x (or --no-veri) skips hooks just like --no-verify. This regex only matches the full spelling, though, and without_option_values doesn't normalize long options. This gap existed before the PR, but the PR rewrites these two patterns to close other spellings of the same flag. Consider matching --no-veri(f(y)?)? (--no-ver is ambiguous with --no-verbose), and add a regression case to test_guard_bypasses.py.
| "(^|[[:space:]])git[[:space:]]+add([[:space:]]+-[^[:space:]]*)*[[:space:]]+(\\./?|-[A-Za-z]*A[A-Za-z]*|--all)([[:space:]]|$)", | ||
| "^git[[:space:]]+commit([[:space:]].*)?[[:space:]]+(--no-verify|-[aeiopqsvz]*n[^[:space:]]*)([[:space:]]|$)", | ||
| "(^|[[:space:]])git[[:space:]]+commit([[:space:]].*)?[[:space:]]+(--no-verify|-[aeiopqsvz]*n[^[:space:]]*)([[:space:]]|$)", | ||
| "(^|[[:space:]])python[0-9.]*([[:space:]]+-[A-Za-z]+)*[[:space:]]+-[A-Za-z]*m[[:space:]]*(pip|ensurepip)([[:space:]]|$)" |
There was a problem hiding this comment.
P2 — A Python option that takes a separate value still hides -m pip. ([[:space:]]+-[A-Za-z]+)* only lets bare flags sit between python and -m. So python3 -W ignore -m pip install x and python3 -X dev -m pip install x don't match, and the interpreter still runs pip. This rule was widened in this PR (for -mpip and python3.12) but still misses these forms. Consider letting the optional group consume the values of -W/-X (for example ([[:space:]]+(-[WX][[:space:]]*[^[:space:]]+|-[A-Za-z]+))*), and add tests for both.
|
Review summary: no blocking (P0/P1) findings, two P2s. I checked the new wrapper option scanning ( The two P2s are inline. Both are bypasses that existed before this PR, but they sit in deny patterns this PR rewrites:
I couldn't run the test suite here, so this review comes from reading the code. 🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🤖 I have created a release *beep* *boop* --- ## 0.1.0 (2026-11-10) ### Features * add devin provider to hooks.json with hook adapter (furedea/dotfiles[#136](#136)) ([5bc5550](5bc5550)) * add git-commit-split skill ([35f4e16](35f4e16)) * add Hermes Agent and pi hook providers (furedea/dotfiles[#138](#138)) ([ed3a774](ed3a774)) * add lock-settings, report-doc-conflict, and report-hook-block skills ([35b8585](35b8585)) * **agents:** add Rust style skill ([a82df41](a82df41)) * **agents:** allow cd, sed, awk, xargs, cp, and mv under the sandbox (furedea/dotfiles[#165](#165)) ([5783f87](5783f87)) * **agents:** bootstrap the harness on servers without Nix ([80a0f9b](80a0f9b)) * **agents:** chain git add, status, commit, and push outside the sandbox (furedea/dotfiles[#169](#169)) ([dd5a05c](dd5a05c)) * **agents:** Codex implements, Claude reviews, and lanes clean up opened workspaces (furedea/dotfiles[#266](#266)) ([c9a3fd9](c9a3fd9)) * **agents:** generate hook settings from nix ([b20d592](b20d592)) * **agents:** hand approved lanes to Herdr task worktree sessions (furedea/dotfiles[#184](#184)) ([58a591f](58a591f)) * **agents:** own personal agent source (furedea/dotfiles[#52](#52)) ([51060b1](51060b1)) * **agents:** permit commands by reversibility (furedea/dotfiles[#124](#124)) ([bb96256](bb96256)) * **agents:** run agent git inside the sandbox with unsigned commits (furedea/dotfiles[#172](#172)) ([1492f3e](1492f3e)) * **agents:** start Herdr Claude lanes on Sonnet at medium effort (furedea/dotfiles[#257](#257)) ([3caf8d5](3caf8d5)) * **agents:** write PR bodies inline and close lanes' parent workspaces (furedea/dotfiles[#211](#211)) ([8c6df4e](8c6df4e)) * **claude:** close the sandbox escape and reach the Nix daemon inside (furedea/dotfiles[#191](#191)) ([b61f2ac](b61f2ac)) * **claude:** let Go CLIs verify TLS inside the sandbox (furedea/dotfiles[#167](#167)) ([282b3d2](282b3d2)) * **claude:** let sandboxed commands listen on local ports (furedea/dotfiles[#206](#206)) ([36c09d2](36c09d2)) * **claude:** run the Codex plugin companion outside the sandbox (furedea/dotfiles[#232](#232)) ([0255159](0255159)) * **codex:** let Codex write, test, and deliver inside the sandbox (furedea/dotfiles[#200](#200)) ([33a0a82](33a0a82)) * compose Herdr and Moshi agent hooks (furedea/dotfiles[#33](#33)) ([4951ee8](4951ee8)) * **dsh:** add the dsh hook adapter ([#101](#101)) ([db86f57](db86f57)) * **git-commit-split:** accept mode from slash-command argument ([10c3ef7](10c3ef7)) * **git-commit-split:** modularize commit splitting workflow with branch ([bab6f19](bab6f19)) * **github:** add repository creation script ([1a7910b](1a7910b)) * **hermes:** use Apple Mail for mail access (furedea/dotfiles[#69](#69)) ([94268fa](94268fa)) * **hooks:** add related test selection rules ([2aca101](2aca101)) * **hooks:** add shared audit and command guard hooks ([6ab33b5](6ab33b5)) * **hooks:** allow read-only local curl diagnostics and log syntax ask kinds (furedea/dotfiles[#287](#287)) ([83cd643](83cd643)) * **hooks:** ask before an agent adds a lint suppression (furedea/dotfiles[#214](#214)) ([b767665](b767665)) * **hooks:** ask only for effects that escape the sandbox (furedea/dotfiles[#163](#163)) ([21409a5](21409a5)) * **hooks:** block destructive non-push git operations ([cc02cb4](cc02cb4)) * **hooks:** escalate unrecognized command forms to a prompt (furedea/dotfiles[#159](#159)) ([e30de17](e30de17)) * **hooks:** fast-forward main after cleaning up merged lanes (furedea/dotfiles[#210](#210)) ([f8a60af](f8a60af)) * **hooks:** honor project allow rules only from trusted owners ([#33](#33)) ([305d391](305d391)) * **hooks:** improve lint-format feedback across providers ([8a512f6](8a512f6)) * **hooks:** judge heredocs, substitutions, loops, and redirections structurally (furedea/dotfiles[#175](#175)) ([9276283](9276283)) * **hooks:** let sessions lock flake inputs and close their own lanes (furedea/dotfiles[#208](#208)) ([f109b49](f109b49)) * **hooks:** let the parent run cleanup_worktrees.py after merge (furedea/dotfiles[#300](#300)) ([fc44c74](fc44c74)) * **hooks:** remove merged task worktrees and branches at session start (furedea/dotfiles[#185](#185)) ([2701e0b](2701e0b)) * **hooks:** replay recent commands through the hooks (furedea/dotfiles[#199](#199)) ([2ed4984](2ed4984)) * **hooks:** report ast-grep rule findings after an edit ([#119](#119)) ([ff91d8c](ff91d8c)) * **hooks:** review only commands that reach past the sandbox (furedea/dotfiles[#178](#178)) ([40c97da](40c97da)) * **hooks:** run zizmor offline after workflow edits (furedea/dotfiles[#295](#295)) ([79b66a6](79b66a6)) * **hooks:** scan with the shared ast-grep rules shipped beside the hooks ([#121](#121)) ([35a9270](35a9270)) * **hooks:** support Go projects in formatting, verification, and permissions ([#57](#57)) ([5506f3c](5506f3c)) * **hooks:** verification selection, unified patch input, formatter/linter ordering (furedea/dotfiles[#144](#144)) ([99a825b](99a825b)) * **lint:** add the first ten ast-grep rules and drop the prose they replace ([#117](#117)) ([c235eb5](c235eb5)) * **nix:** expose the plain agents path as passthru.tree of agent-source ([#94](#94)) ([63632e4](63632e4)) * **security:** add a program_path option that pins a rule's program to one absolute path ([#61](#61)) ([d629ca9](d629ca9)) * **security:** allow agent-browser and agent-desktop except named risky forms ([#63](#63)) ([8dc8da5](8dc8da5)) * **security:** allow cargo caches, crates.io, and OSV in the sandbox ([#60](#60)) ([2f29423](2f29423)) * **security:** allow Go caches and module hosts in the sandbox ([#58](#58)) ([4b3a35c](4b3a35c)) * **security:** ask for every docker form the allowlist does not list ([#54](#54)) ([764374f](764374f)) * **security:** deny the 1Password CLI and keep the Codex login in the keyring ([#52](#52)) ([0580825](0580825)) * **skill-auditor:** support Codex audit workflow ([0d88c3f](0d88c3f)) * **skills:** add measurement-evidence and change-type evidence to tsdd ([#70](#70)) ([85714b5](85714b5)) * **skills:** clarify names and add Herdr delegation (furedea/dotfiles[#127](#127)) ([e6576ba](e6576ba)) * **skill:** skill-auditor by nyosegawa/skills/skill-auditor ([f191132](f191132)) * **skills:** render provider-specific SKILL.md frontmatter ([44325e5](44325e5)) * **statusline:** render the status on one line (furedea/dotfiles[#110](#110)) ([03ad85e](03ad85e)) * update bash-style skill instructions ([9ab1d65](9ab1d65)) * update github-ci-init skill templates ([d238f51](d238f51)) * verify agent changes through native hooks (furedea/dotfiles[#106](#106)) ([923b0ae](923b0ae)) ### Bug Fixes * **agents:** accept generated command permissions (furedea/dotfiles[#66](#66)) ([0af9650](0af9650)) * **agents:** allow gh api reads that pass --allow-escape-sequences (furedea/dotfiles[#265](#265)) ([e732939](e732939)) * **agents:** apply harness review findings (furedea/dotfiles[#149](#149)) ([c8a51d7](c8a51d7)) * **agents:** cap Codex session-end timeout ([2f29a7e](2f29a7e)) * **agents:** deny codex-companion calls the sandbox exclusion cannot match (furedea/dotfiles[#269](#269)) ([25518ab](25518ab)) * **agents:** harden hooks and separate workflow responsibilities (furedea/dotfiles[#128](#128)) ([7e508c4](7e508c4)) * **agents:** let pnpm fetch from the npm registry inside the sandbox (furedea/dotfiles[#222](#222)) ([ac114e8](ac114e8)) * **agents:** let the forbidden rule admit Sonnet lane arguments (furedea/dotfiles[#259](#259)) ([f1b29a9](f1b29a9)) * **agents:** make the bootstrap hint work for POSIX login shells ([c2667fa](c2667fa)) * **agents:** stop asking for commands the hooks can prove safe (furedea/dotfiles[#242](#242)) ([a93d241](a93d241)) * **agents:** wait for hook state locks instead of failing with EAGAIN (furedea/dotfiles[#285](#285)) ([673c108](673c108)) * allow secret scanner hook files ([bca4207](bca4207)) * **bootstrap:** give Codex the agent GitHub token settings and run the bootstrap in CI ([#21](#21)) ([25de080](25de080)) * **bootstrap:** keep Neovim's fallback nvim.log out of the working directory ([#43](#43)) ([3c9fc5c](3c9fc5c)) * **bootstrap:** make the server bootstrap behave like the Nix hosts ([#15](#15)) ([4554dec](4554dec)) * **bootstrap:** print actionable profile and legacy-file messages only when needed ([#49](#49)) ([1918254](1918254)) * **bootstrap:** target the login profile bash actually reads ([#50](#50)) ([0dae5bf](0dae5bf)) * **bootstrap:** verify downloaded tools against pinned checksums ([#111](#111)) ([1744df3](1744df3)) * **ci:** install the locked agent-harness instead of reading it from the flake ([bc2395b](bc2395b)) * **ci:** provide the shell format config and locked JavaScript tools ([dd59634](dd59634)) * **claude:** trust only the CA store bundled with Claude Code (furedea/dotfiles[#284](#284)) ([34be271](34be271)) * **codex:** fall back to auth.json when no keyring is available ([#62](#62)) ([79b6ceb](79b6ceb)) * correct agent tooling and Hister activation (furedea/dotfiles[#85](#85)) ([4bab065](4bab065)) * honor pytest testpaths and bootstrap bats on servers (furedea/dotfiles[#116](#116)) ([b17b59e](b17b59e)) * **hooks:** allow double quoted commit messages ([fc4afd4](fc4afd4)) * **hooks:** bound curl -o, -d and -H in the localhost rule (furedea/dotfiles[#291](#291)) ([7c9db8a](7c9db8a)) * **hooks:** close shell-syntax bypasses of the guard hooks ([#11](#11)) ([c6aacdf](c6aacdf)) * **hooks:** close the guard contract gaps from [#11](#11) review ([#31](#31)) ([db318db](db318db)) * **hooks:** deny codex-companion calls whose text holds a dollar sign or backtick (furedea/dotfiles[#290](#290)) ([f37c317](f37c317)) * **hooks:** find GNU grep on PATH instead of the first grep (furedea/dotfiles[#193](#193)) ([99ba317](99ba317)) * **hooks:** format without dotfiles-installed dprint and prettier configs ([#16](#16)) ([db21f55](db21f55)) * **hooks:** ignore git-ignored sources when judging a project removed ([#22](#22)) ([97c6b93](97c6b93)) * **hooks:** ignore prose arguments when matching forbidden patterns (furedea/dotfiles[#189](#189)) ([d2049d6](d2049d6)) * **hooks:** judge each command as one line with any grep (furedea/dotfiles[#196](#196)) ([202f937](202f937)) * **hooks:** keep merged worktrees holding non-regenerable ignored files ([#29](#29)) ([ac03cfa](ac03cfa)) * **hooks:** keep the first grep when no GNU grep is on PATH (furedea/dotfiles[#195](#195)) ([a0e6a2f](a0e6a2f)) * **hooks:** keep the verification snapshot from locking out symlinked or large worktrees ([#66](#66)) ([7d13f0e](7d13f0e)) * **hooks:** let cleanup_worktrees remove Claude Code session files ([#36](#36)) ([0a910bc](0a910bc)) * **hooks:** let cleanup_worktrees tests choose the untrusted locations (furedea/dotfiles[#306](#306)) ([e82980e](e82980e)) * **hooks:** let GitHub API reads take an unquoted jq filter (furedea/dotfiles[#198](#198)) ([5b6210a](5b6210a)) * **hooks:** make stop verification reliable (furedea/dotfiles[#81](#81)) ([04a33dd](04a33dd)) * **hooks:** preserve verification evidence (furedea/dotfiles[#87](#87)) ([4b5b9c2](4b5b9c2)) * **hooks:** redirect sandbox-failing Git forms and drop covered prompts (furedea/dotfiles[#180](#180)) ([34e39a7](34e39a7)) * **hooks:** resolve Rust integration test targets inside tests subdirectories (furedea/dotfiles[#304](#304)) ([2ccf547](2ccf547)) * **hooks:** respect project formatters and bound diagnostics (furedea/dotfiles[#131](#131)) ([30e83cf](30e83cf)) * **hooks:** scope generic secret regex to quoted values ([fc09292](fc09292)) * **hooks:** silence successful hook execution ([795d8f0](795d8f0)) * **hooks:** skip JavaScript triggers in projects without JavaScript tests (furedea/dotfiles[#161](#161)) ([dc80e28](dc80e28)) * **hooks:** skip verification for a language whose project was removed ([#6](#6)) ([4a9f325](4a9f325)) * **hooks:** support relocated harness assets (furedea/dotfiles[#82](#82)) ([59057bc](59057bc)) * **hooks:** treat any gh api call without write flags as a read (furedea/dotfiles[#201](#201)) ([3ecb215](3ecb215)) * **hooks:** treat glob characters inside double quotes as literal for literal_words rules ([#41](#41)) ([174a7f9](174a7f9)) * **hooks:** use agent-neutral guidance ([37153ce](37153ce)) * improve agent notifications and session setup (furedea/dotfiles[#92](#92)) ([9bf2349](9bf2349)) * load secret patterns from hook directory ([ca465ef](ca465ef)) * migrate dotfiles path to ghq convention ([faff774](faff774)) * **nix:** build CPython 3.15.2 for the ssl eMudhra denylist ([#113](#113)) ([faba045](faba045)) * **nix:** default editor to Neovim (furedea/dotfiles[#105](#105)) ([2a9a22a](2a9a22a)) * resolve hook directory from bash source ([c6ca454](c6ca454)) * restore SSH signing and reliable Bats verification (furedea/dotfiles[#91](#91)) ([891adce](891adce)) * **sandbox:** deny writes to every repository's git hooks and config (furedea/dotfiles[#298](#298)) ([1941513](1941513)) * **sandbox:** match the Codex plugin script under any numeric version (furedea/dotfiles[#302](#302)) ([a49ddc3](a49ddc3)) * **security:** allow the Go checksum tree head and vulnerability database in the sandbox ([#59](#59)) ([af6e158](af6e158)) * **security:** ask for every script a non-bash shell receives ([#99](#99)) ([f88f8fd](f88f8fd)) * **security:** close quoted-argument and wrapper bypasses in the command guard ([#76](#76)) ([5f72757](5f72757)) * **security:** close the remaining command guard bypasses ([#83](#83)) ([0387739](0387739)) * **security:** decide not-a-fork for project rules on hosts without gh ([#67](#67)) ([acaa758](acaa758)) * **security:** keep agent-browser and agent-desktop calls inside the sandbox ([#64](#64)) ([3f2d578](3f2d578)) * **security:** read more of the scripts handed to fish and PowerShell for deny rules ([#110](#110)) ([2c652bb](2c652bb)) * **skills:** audit Codex skill observations (furedea/dotfiles[#88](#88)) ([f429967](f429967)) * **skills:** refine routing triggers from audit ([cef3b9c](cef3b9c)) * **tests:** make git test wrappers exec the real git binary (furedea/dotfiles[#310](#310)) ([893c405](893c405)) * **tests:** stop shifting past the codex wrapper arguments ([eb0f6d7](eb0f6d7)) ### Performance Improvements * **hooks:** evaluate policy regexes with one grep and run pytest in parallel (furedea/dotfiles[#125](#125)) ([ce80ea3](ce80ea3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
概要
#76 で塞ぎきれなかったコマンド guard の抜け道を塞ぐ.
script,taskset,chrt,flock,watch,doasをWRAPPERSに加え,各ラッパー固有のオプションを解釈する.未知のオプションは ask.csh,tcsh,fish,rc,nuなど)と,shで終わる未知の名前の-cは ask.time,否定,シェルスクリプトの中に置いた ask prefix(gh pr merge,docker runなど)を,hook 自身が ask にする.forbidden_commands.jsonがpython3 -mpip install x,git commit -nm x,git add -- .を deny する.git commit -m "--no-verify"の回帰(fix(security): close quoted-argument and wrapper bypasses in the command guard #76)を直す.git commitのオプションの値は,フラグ判定から除く.shell_syntax.pyが 500 行の制限を超えたため,ラッパーのオプション解析をshell_wrappers.pyに分けた.回帰テスト
tests/hooks/test_guard_bypasses.py(212 件).Issue の表の入力ごとに,修正前に期待どおりの理由で失敗することを確認した.全テスト(3600 件超),ruff,ruff format,ty は通る.レビュー
Codex(
gpt-6.1-sol,xhigh)で 7 回回した(7 回目の結果は上の表).1 〜 6 回目の指摘(P1 が 17 件ほか)はすべて直し,それぞれ回帰テストを足した.レビュー(CI)と未対応の指摘(LANE-BLOCKED)
手元の Codex レビューは止め,CI の
claude-reviewとcodex-reviewに切り替えた.origin/mainへのリベースは済み.chrtの+0と--,git commit -- -notes.txt)は,回帰テスト付きで直した(cf68578).cf68578): Codex は指摘なし.Claude の P2(.shとsshを未知のシェルとして ask)を直した(2dc322a).2dc322a): Codex は指摘なし.Claude が新しい指摘を 2 件出した.-cの後のオプションを飛ばして最初のオプションでない語を読むよう直した(回帰テスト付き).shell_syntax.py:366bash -c -- 'gh repo delete x --yes',sh -c -e 'gh pr merge 76 --merge'が allow.-cの直後の語をスクリプトとみなすが,bash,dash,zsh は最初のオプションでない語を読む(この PR の前からある挙動)shell_syntax.py:53pwsh -Command '…'(大文字 C),pwsh -e,nu --commands,echo '…' | fish,fish <<EOFが allow.外部シェルの検査が小文字cと--commandだけで,標準入力も読まないforbidden_commands.json:10git commit --no-verif -m x(git は一意な接頭辞の長いオプションを受け付ける)が deny されない.この PR の前からあるforbidden_commands.json:11python3 -W ignore -m pip install x,python3 -X dev -m pip install xが deny されない.この PR の前からあるCI 3 回目(
250b7ea): Codex は指摘なし.Claude は P0/P1 なしで,P2 を 2 件(上の 2 行)出した.all-greenは green.繰り返しの指摘(記録のみ): 2 回目の Claude の P2 が
.shとsshの ask を再び挙げているが,2dc322aで直し済みで,回帰テストがある(旧コードの正規表現を引いた古い指摘).そのほか
Closes #77
🤖 Generated with Claude Code