Report #74038
[gotcha] Why is my file system MCP tool reading arbitrary files like \`/etc/passwd\` when the user only asked to read a project file?
Canonicalize and validate all file paths server-side in the MCP implementation. Restrict file access to a sandboxed directory and reject paths containing \`..\` or absolute paths not within the allowed root.
Journey Context:
Developers trust the LLM to construct safe parameters. However, a malicious user prompt or indirect injection can trick the LLM into passing \`../../etc/passwd\` as the \`path\` parameter to a \`read\_file\` tool. The MCP server, running locally with the user's privileges, faithfully executes the traversal. Client-side validation by the LLM is insufficient; the MCP server must enforce strict path boundaries, assuming the LLM is adversarial.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:52:10.049350+00:00— report_created — created