Repository navigation
Close four write-guard bypasses - #8
Merged
Merged
Conversation
- package.json leaves the layout. `npm test` is pre-approved, so an agent that could rewrite the script could run any command without a prompt. - Both hooks resolve the target as the disk spells it before matching a rule. On Windows and macOS, catalog/Provisions.json reached the read-only catalog and FLAGS.jsonl rewrote the append-only log. - The expert gate parses the file as it would be saved, so an Edit that swaps only the value, or a \u escape, is blocked. - The calculator's --out writes only a new matters/<id>/calc/<run>.json and never overwrites one. It runs through Bash, outside the hooks. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
3 of 5 tasks
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.
Four ways past the write-guard, each reproduced against
mainbefore the fix.What changed
package.jsonleaveslayout.json.npm testandnpm run validateare pre-approved in.claude/settings.json, so an agent that could rewrite the script could run any command with no prompt.realPathinlib.mjs). On Windows and macOS,catalog/Provisions.jsonmatchedcatalog/**and landed on the read-only catalog, andmatters/x/FLAGS.jsonlrewrote the append-only log.pending_expert_reviewtoexpert_validatedcarried no key in its new text, and a Write withexpert\u005fvalidateddodged the pattern. Both now exit 2. Side effect: an agent can no longer edit a result a human has already markedexpert_validated.--outwrites only a newmatters/<id>/calc/<run>.jsonand never overwrites one.npm run calc:*is pre-approved and runs through Bash, outside the hooks, so--outcould reach the catalog, a flag log orsettings.json.SECURITY.mdno longer lists this as a known limit.Tests
npm test: 27 pass, 0 fail, 2 skipped on Windows.npm run validate -- --strictis clean.The new test, "another spelling of a guarded path is still guarded", needs a case-insensitive disk. It skips on Ubuntu, so this CI does not exercise that fix. A
windows-latestjob would.Not in this PR
.github/**stays agent-writable.🤖 Generated with Claude Code