MCP audit rule · v0.1.0
Secret in command arguments
Arguments are visible in process listings and logs, and the config file is often shared.
- each server checks
- 2 test fixtures
critical secret-in-args
Flagged
5 "args": [
6 "--token",
7 > "ghp_••••0000"
8 ]
9 }Fix
Read the secret from an environment variable the server supports, referenced as "${env:NAME}", and rotate the exposed key.
Fine
{
"mcpServers": {
"s": {
"command": "npx",
"args": [
"--token",
"${env:GITHUB_TOKEN}"
]
}
}
}