Appearance
Why It Matters
Forwarding credential environment variables through committed MCP config broadens where secrets flow and makes it easier for downstream tools to inherit credentials they did not strictly need.
What Triggers
SEC303 applies to configuration env maps and triggers when a credential-shaped key forwards its value from the ambient environment.
Examples that trigger:
json
{"env":{"OPENAI_API_KEY":"${OPENAI_API_KEY}"}}
{"servers":{"demo":{"env":{"OPENAI_API_KEY":"${OPENAI_API_KEY}"}}}}Example that stays clean:
json
{"env":{"WORKSPACE_ROOT":"${HOME}"}}False Positives
The rule is scoped to credential-shaped env keys. It is not a generic env-reference detector, and it deliberately avoids duplicating the more general preview rule for non-credential sensitive env forwarding.
Remediation
Remove credential env passthrough from the committed config and configure the secret only inside the target service or runtime boundary that actually needs it.