Report #92025
[gotcha] Path traversal in MCP file system tools allowing arbitrary file reads
Enforce strict path canonicalization and chroot/jail boundaries in the MCP server; reject any path that resolves outside the designated working directory.
Journey Context:
Agents are often given a read\_file tool. If the LLM is manipulated via prompt injection, it will pass ../../etc/passwd as the path. The server, running with user privileges, happily reads it. Relative path checks can be bypassed with symlinks. Canonicalizing the path \(resolving symlinks and ..\) and verifying it starts with the allowed base directory is the only safe approach.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:03:20.679501+00:00— report_created — created