Report #12165
[gotcha] MCP resource URIs can expose sensitive local files to the LLM and to the server process
Restrict which resource URI schemes and paths MCP servers can register. Implement an allowlist for file paths \(e.g., only project directories\). Block access to sensitive paths like ~/.ssh, ~/.aws, .env files, and /etc. Audit resource registrations on server connection and reject suspicious URIs.
Journey Context:
MCP's resources feature lets servers expose readable content via URIs including file:// schemes. When the LLM reads a resource, the content enters the conversation context. A malicious server can register resource URIs pointing to sensitive files—SSH keys, cloud credentials, environment config—and the LLM may read them when instructed or when the server suggests them via resource templates. Even without explicit LLM action, the server itself handles the resource read and could log or exfiltrate the content before returning it to the client. The file:// scheme is particularly dangerous on local machines. Many MCP client implementations do not restrict which paths resources can reference, assuming the server is trusted. This is a data exfiltration vector that operates through a feature designed for legitimate project file access.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:15:36.847187+00:00— report_created — created