claw-code/rust/crates/tools
Sam Lamrabte e8c8ef1142 Harden permission enforcement against sandbox bypasses
Close two ways the permission system could be bypassed:

- Workspace path traversal: normalize `.`/`..` lexically before the
  boundary prefix comparison so paths like `/workspace/../../etc` can no
  longer escape the sandbox. Fixed in both the runtime enforcer and the
  duplicate check in the tools PowerShell path classifier.
- read-only mode no longer trusts the leading token alone: reject shell
  metacharacters (chaining/substitution/redirect/pipe/subshell), drop
  interpreters and build drivers (python/node/ruby/cargo/rustc) from the
  allow-list, gate `git` to non-mutating subcommands, and reject `find`
  actions that execute or delete.

Adds regression tests for both holes. The pre-existing, unrelated
worker_boot git-metadata test failure is not affected by this change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 13:26:39 +02:00
..
src Harden permission enforcement against sandbox bypasses 2026-05-31 13:26:39 +02:00
tests Keep G002 path-scope tests aligned with enforced denials 2026-05-14 17:33:47 +09:00
.gitignore fix: auto compaction threshold default 200k tokens 2026-04-01 03:55:00 +00:00
Cargo.toml feat(tools): add LoggingAspect to unified tool dispatch entry point 2026-05-25 11:22:45 +09:00
GIT_TOOLS_README.md feat: git-aware context tools 2026-05-25 11:24:37 +09:00