Appearance
Why It Matters
Broad repo-local .env loading can silently inject more credentials and local state than the MCP client or server actually needs. That makes the committed client config less reviewable and widens secret exposure by default.
What Triggers
SEC336 applies to repo-local MCP client config such as .cursor/mcp.json or .vscode/mcp.json and triggers when a server entry loads a broad dotenv-style envFile.
Example that triggers:
json
{"servers":{"demo":{"envFile":".env"}}}Examples that stay clean:
json
{"servers":{"demo":{"envFile":"configs/server.env.json"}}}
{"servers":{"demo":{"envFile":"${workspaceFolder}/.env"}}}False Positives
This rule stays Preview because whether broad env-file loading is materially risky depends on repo policy and the actual env contents. The signal is still useful as a review prompt because the client config is opting into wide secret ingestion.
Remediation
Prefer narrower explicit env injection over broad repo-local .env files for committed MCP client configs, or make the path clearly workspace-scoped and reviewable.