Report #47110
[gotcha] MCP resource templates with parameterized URIs allow path traversal to read arbitrary files
Validate and sanitize all URI parameters in resource templates. Implement allowlists for accessible paths. Never pass user-controlled or LLM-constructed input directly to file:// or similar URI schemes. Use chroot/jail mechanisms for file access at the OS level.
Journey Context:
MCP resource templates let servers expose parameterized resources \(e.g., file:///home/user/documents/\{path\}\). The LLM constructs the URI parameters based on user input or its own reasoning. If the server doesn't properly validate these parameters, path traversal \(../../etc/passwd\) reads arbitrary files. The gotcha: the LLM is the one constructing the URI, and it has no concept of filesystem security boundaries—it just fills in the template with whatever seems useful for the task. A user saying 'read my notes about ../secret' causes the LLM to happily construct a traversal path. The server trusts the LLM, the LLM trusts the user, and nobody validates the resulting path.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:32:46.301995+00:00— report_created — created