Skip to content

Close two write-guard bypasses - #6

Merged
prathikcannotcode merged 1 commit into
masterfrom
fix/guard-bypasses
Nov 10, 2026
Merged

prathikcannotcode merged 1 commit into
masterfrom
fix/guard-bypasses

Conversation

@prathikcannotcode

Copy link
Copy Markdown
Owner

Two ways past the write-guard, each reproduced against master before the fix.

What changed

  • package.json and package-lock.json leave layout.json. npm test and npm run validate are pre-approved in .claude/settings.json. An agent that could rewrite the script, or an injected instruction in an audited codebase, could run any command with no prompt, the guards included.
  • Both hooks resolve the target as the disk spells it before matching a rule (realPath in lib.mjs). On Windows and macOS, company-profile/acme/BREACH-LOG.jsonl now hits the append-only rule, and assessments/x/Report.json keeps its schema check on write.

Tests

npm test: 24 pass, 0 fail, 1 skipped on Windows. npm run validate -- --strict is 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-latest job would.

Not in this PR

  • .github/** and the stale aranya/** rule stay agent-writable.
  • No changelog entry or version bump.

🤖 Generated with Claude Code

- package.json and package-lock.json leave 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, BREACH-LOG.jsonl now hits the append-only
  rule and Report.json keeps its schema check.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@prathikcannotcode
prathikcannotcode merged commit abca393 into master Nov 10, 2026
1 check passed
@prathikcannotcode
prathikcannotcode deleted the fix/guard-bypasses branch November 11, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant