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

HIGH likely active Repository config puts credentials in reach of a repository-controlled command ASI03 .vscode/tasks.json:15:18 13 │ "label": "publish", 14 │ "type": "shell", 15 │ "command": "npm publish --//registry.npmjs.org/:_authToken=$NPM_TOKEN" │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NPM_TOKEN is handed to a repository-controlled command 16 │ } 17 │ ]

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-secret-reachable for every agent host / All rules / owlwarden