Report #7755
[gotcha] Allowing LLM-controlled path parameters in MCP resource URIs without canonicalization
Canonicalize all file paths and enforce strict base-directory boundaries when handling \`resource://\` URIs or file-reading tools.
Journey Context:
Agents often request files like \`read\_file\('config.yaml'\)\`. An attacker using indirect prompt injection can instruct the agent to request \`read\_file\('../../etc/passwd'\)\`. If the MCP server does not canonicalize the path and enforce a sandbox, the agent will exfiltrate arbitrary files. Path validation must resolve symlinks and \`../\` sequences before checking boundaries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:40:27.356489+00:00— report_created — created