Repository navigation
fix(guard): stop false shell refusals, allow .env templates (2.157.2) - #223
Merged
Merged
Conversation
…(2.157.2) The Bash hook treated path-spelling checks as final, and c3_shell refused any token matching a deny glob, so revspecs, //F switches, // comments and regex text were hard refusals. Spelling hits are now judged as the file they could reach, c3_shell refuses only existing denied files, and both scans judge quoted paths whole, which also catches quoted paths with spaces. Risk: quoted |;& still split tokens. Replay of 1,200 logged refusals: 1,074 refused on main, 134 here; full suite 4916 passed, ruff clean. Claude-Session: https://claude.ai/code/session_01XyQBQ8ZNaNYDuhwQEnLsG2
|
Gro could not finish this review. |
The builtin denied reading and editing .env.example and similar committed templates, which list variable names only. A leaf ending in .example, .sample, .template or .dist is no longer covered, in every builtin mode. Risk: a template that does hold a real value becomes readable; a user deny rule still covers it. Suite 4919 passed, ruff clean. Claude-Session: https://claude.ai/code/session_01XyQBQ8ZNaNYDuhwQEnLsG2
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.
The Bash hook treated the path-spelling checks (
<ads>,<unc>,<empty-component>,<8.3-alias>) as final, and c3_shell refused any token matching a deny glob whether or not a file existed, soorigin/main:$f,taskkill //F,//comments,...and\.envin a grep regex were hard refusals. A spelling hit is now re-judged as the file it could reach, c3_shell refuses only existing denied files (cwd pluscdtargets, unquoted globs expanded), and both scans judge quoted strings whole, which closes a gap where a quoted path with spaces to a protected file passed the hook. Replaying 1,200 logged refusals from the last 80 days: 1,074 still refused on main, 134 on this branch, and the 134 are real reads of.envand key files plus one docker//tmppath. Second commit:.envtemplates ending in.example,.sample,.templateor.distare no longer covered by the**/.env*builtin (21 refusals in the same window); a template holding a real value becomes readable unless a user rule denies it. Known limit:|,;and&inside quotes still split tokens. Locally: full suite 4919 passed / 8 skipped on Windows, ruff clean; the new or changed tests fail on main.https://claude.ai/code/session_01XyQBQ8ZNaNYDuhwQEnLsG2