Report #13496
[gotcha] File reading/writing tools allow path traversal outside intended directories
Enforce strict path canonicalization and chroot/jail boundaries on the MCP server. Reject requests containing .. or symlinks that resolve outside the allowed base directory.
Journey Context:
Agents are often given read\_file or write\_file tools. If the server doesn't canonicalize the path, an agent \(or a prompt injection forcing the agent\) can request ../../etc/shadow. Symlinks created by the agent can also bypass directory restrictions. Canonicalization and strict boundary checks on the server side are the only reliable defenses.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:51:41.399312+00:00— report_created — created