Fix repository config puts credentials in reach of a repository-controlled command in VS Code
A hook command, task, or MCP server declaration in this repository references a credential-shaped variable, or asks for the whole process environment. Nothing is hardcoded - the secret is stored correctly and then handed to a command the repository controls.
high likely VS Code CWE-522 / ASI ASI03
The vulnerable pattern in VS Code
This finding comes from the VS Code fixture in the owlwarden test suite. `NPM_TOKEN` is stored correctly - in the environment - and then passed to a command this repository defines. Whoever can edit that command can read the secret, and a pull request is enough to edit it.
The corrected configuration
Do not reference secrets in `tasks.json` or in a dev container's `containerEnv`. Use the editor's secret input variables, which prompt the developer, or read the value inside the script where it is used.
// .vscode/tasks.json
"options": { "env": {} } // nothing inherited
If you are not using VS Code
Stop passing the credential to a repository-defined command. Give the subprocess an explicit environment allowlist holding only what it needs, and keep everything else out of its reach.
Check your own repository
npx owlwarden scan
npx owlwarden explain agent-config-secret-reachable
Runs on your machine. No account, no telemetry, no network unless you ask. In CI, SARIF uploads to code scanning and the exit code is the gate.
Other VS Code checks
Rules with a tested VS Code example.
- agent-config-env-redirect high Repository config redirects the agent's API traffic
- agent-config-loader-script high Executable script inside an agent or editor config directory
- agent-hook-autoexec high Repository config executes a command when the workspace is opened
- agent-hook-untrusted-command high Hook command reaches outside the project
- agent-mcp-unpinned-remote medium MCP server declaration resolves code at run time
- agent-permission-wildcard medium Repository config pre-approves a broad tool permission
agent-config-secret-reachable for every agent host / All rules / owlwarden