Report #50457
[gotcha] Path traversal attacks in file-access MCP servers via relative paths in arguments
Canonicalize all file paths provided by the LLM and verify they reside strictly within the allowed root directory. Reject paths containing \`..\` or symlinks pointing outside the sandbox.
Journey Context:
Even if a tool is designed to read files in \`/workspace\`, the LLM might be tricked \(via indirect injection\) into passing \`/workspace/../../etc/shadow\`. Simple string prefix checking fails if \`..\` or symlinks are used, allowing arbitrary file read.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:10:33.231813+00:00— report_created — created