Repository navigation
fix(protected-path): deny agent writes to the harness state dir and HMAC key - #142
Merged
Merged
Conversation
…MAC key - protected-path-targets/commands: normalised match on ~/.fuse-harness/state/ and ~/.fuse-harness/.key for Write/Edit and precise Bash write-target extraction (`//`, `/./`, `/../` cannot hide them); legacy protected paths keep their verdicts - paths.ts: document the guard; reads stay allowed - tests: receipt-tamper data, guards, hosts; protected-path-new
securityGuard returned the generic rm ASK before protectedPathGuard could deny, so rm of the harness state dir/HMAC key was a liftable ask on Linux and real macOS homes — macOS CI passed only via the unrelated /var system-dir rule. denyOverAsk only turns ask->deny for receipt-store targets. Receipt-tamper tests updated to the #141 hash-chain truth.
2 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.
Summary
~/.fuse-harness/state/and~/.fuse-harness/.key(normalised match://,/./,/../cannot hide them). Legacy protected paths keep their exact verdicts; reads stay allowed. The harness's own writes run inside the hook process, never through a tool call.Real hook run (built
dist/cli/bin.mjs,hook claude-code, sandbox HOME)/./and/../echo {} > state trackcp /tmp/k .keylsstate dir (control)echo hi > scratch file(control)Test plan
bun test+tsc --noEmitlocally vs origin/main baseline