Report #2891
[gotcha] LLM reads sensitive files via path traversal in file tools
MCP file servers must resolve paths using realpath and enforce a strict chroot/jail boundary, rejecting any path that attempts to traverse outside the explicitly allowed base directories.
Journey Context:
Developers often assume the LLM won't ask for /etc/passwd or ../../.ssh/id\_rsa. But under prompt injection, the LLM will do exactly that. If the server simply concatenates the base path with the input, traversal is trivial. Canonicalizing the path and checking it against the allowed root 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-15T14:34:03.953280+00:00— report_created — created