Report #77226
[gotcha] How do attackers read arbitrary files using MCP resource templates?
Strictly validate and sanitize URI parameters in MCP resource templates; enforce strict path boundaries and reject sequences like '..' or absolute paths.
Journey Context:
MCP allows parameterized resource URIs \(e.g., file:///projects/\{name\}/config.yaml\). Developers assume the LLM will only pass valid project names. However, prompt injection or adversarial input can cause the LLM to pass '../../etc/passwd' as the name parameter. Because the MCP server trusts the agent's request, it resolves the path and leaks the file, leading to Local File Inclusion \(LFI\). Never trust agent-supplied parameters for filesystem or URL construction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:13:16.677341+00:00— report_created — created