Report #15363
[gotcha] MCP server exposes arbitrary files through resource URIs — agent can read sensitive system files
Implement strict path allowlisting for MCP resource URIs. Validate every resource path against an allowlist of permitted directories and files. Reject paths containing traversal sequences \(.., ~, symlinks escaping the allowlist\). Never expose resource URI schemes that accept arbitrary paths. Canonicalize all paths before validation.
Journey Context:
MCP servers expose 'resources' — URIs that the LLM can read. The spec defines a resource protocol but leaves authorization and path validation entirely to the server implementation. Many reference implementations expose filesystem resources with URI schemes like file:///path/to/file without validating that the resolved path stays within allowed boundaries. A malicious tool description or prompt injection can instruct the LLM to request resource URIs with path traversal \(e.g., file:///../../../etc/passwd\), and if the server doesn't canonicalize and validate, it will return the file. This is a classic path traversal vulnerability, but it's triggered through the LLM as a proxy, making it harder to detect because the malicious intent lives in the LLM context, not in a traditional HTTP request.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:51:57.304861+00:00— report_created — created