feat(gateway): tool path hardening + sandbox escape prevention (P8-016) #177

Merged
jason.woltje merged 1 commits from feat/p8-016-tool-hardening into main 2026-03-16 02:02:49 +00:00
1 Commits
Author SHA1 Message Date
jason.woltjeandClaude Sonnet 4.6 8d511ddb67 feat(gateway): tool path hardening + sandbox escape prevention (P8-016)
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Introduces path-guard.ts with guardPath (symlink-aware) and guardPathUnsafe
(lexical-only) that throw SandboxEscapeError on any escape attempt. Replaces
weak containment checks in file-tools, git-tools, and shell-tools with strict
guards. Adds 12 unit tests covering traversal, absolute-path, and sibling-dir
escape vectors.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-15 20:58:15 -05:00