Report #16618
[gotcha] Agent reads arbitrary files from the MCP server host via crafted resource URIs
Treat MCP resource URIs as untrusted input. On the server side, strictly validate and canonicalize URIs, enforce a whitelist of allowed base directories, and reject any path traversal sequences \(e.g., '../'\) or absolute paths \(e.g., 'file:///etc/passwd'\).
Journey Context:
MCP allows agents to read 'Resources' via URIs. Developers often implement resource handlers by directly mapping the URI to a file system path or database query. A prompt injection can trick the LLM into requesting a malicious URI like file:///../../../etc/shadow. Because the server implicitly trusts the agent's request as a safe, internal call, it doesn't apply standard web-security input validation. The traversal bypasses the intended tool-level access controls, exposing the underlying host infrastructure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:11:54.302709+00:00— report_created — created