mirror of
https://github.com/lukaszraczylo/filepuff-mcp.git
synced 2026-10-12 04:54:27 +00:00
file_search runs ripgrep with --follow on by default, so a symlink inside the workspace pointing outside it (e.g. link -> /etc) caused rg to traverse out and return matches from external files — leaking their content to the caller despite the workspace-scoping contract. parseOutput emitted match paths verbatim with no re-validation. Filter every match through IsPathAllowed (resolving rg's workspace-relative path against the root first); IsPathAllowed's EvalSymlinks rejects the escape while still permitting legitimate worktree siblings. Defense in depth that also covers --no-ignore and any other traversal that reaches outside the root. Adds a security regression test (proven to fail without the filter).