You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 18, 2026. It is now read-only.
The handleExecScript() handler in mcp.go validates that script paths are contained within the project directory, but the test suite does not include path traversal attack vectors. Similarly, the executor's file path validation in executor.go (lines 82-107) lacks tests for symlink resolution, Windows UNC paths, and normalization edge cases.
Impact
Path traversal is a critical security boundary for the MCP server — it prevents execution of arbitrary scripts outside the project
Without explicit adversarial test cases, future refactors could inadvertently weaken this validation
Windows-specific path edge cases (UNC paths, alternate data streams, 8.3 short names) are not covered
Current Test Coverage
What IS tested (mcp_test.go:393-445):
Script path with valid project-relative path
Nonexistent file rejection
Directory path rejection
Empty path rejection
What is NOT tested:
Relative path traversal: ../../etc/passwd or ....\windows\system32\cmd.exe
Summary
The handleExecScript() handler in mcp.go validates that script paths are contained within the project directory, but the test suite does not include path traversal attack vectors. Similarly, the executor's file path validation in executor.go (lines 82-107) lacks tests for symlink resolution, Windows UNC paths, and normalization edge cases.
Impact
Current Test Coverage
What IS tested (mcp_test.go:393-445):
What is NOT tested:
Recommendation
Add a dedicated test table in mcp_test.go with adversarial path inputs:
Each test case should verify the handler returns an error and does NOT attempt execution.