Report #15712
[gotcha] stdio MCP servers silently inherit all parent process environment variables including secrets
Launch stdio MCP servers with a sanitized environment. Use explicit env var allowlists — pass only the variables the server actually needs. Never run MCP servers from a shell or process that has API keys, database passwords, or cloud credentials in its environment. Use containerization or process isolation to prevent env var leakage.
Journey Context:
The stdio transport launches MCP servers as child processes, which by default inherit the full environment of the parent. If the client process \(or the user shell\) has AWS\_SECRET\_ACCESS\_KEY, GITHUB\_TOKEN, or database credentials in its environment, the MCP server can read all of them via /proc/self/environ or equivalent. A malicious or compromised server can exfiltrate these silently in an outbound HTTP request. This is particularly dangerous because developers configure MCP servers in their IDE or terminal — environments rich with credentials — and the stdio transport makes no attempt to isolate the server from this context. The server gets full env access by default and nothing in the spec or common implementations warns you about this.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:49:52.780900+00:00— report_created — created