Fix repository config puts credentials in reach of a repository-controlled command in Cursor
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 Cursor CWE-522 / ASI ASI03
The vulnerable pattern in Cursor
This finding comes from the Cursor fixture in the owlwarden test suite. `GITHUB_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
Narrow the `env` block in `.cursor/mcp.json` to the one variable the server needs, and take credential interpolation out of hook commands entirely.
// .cursor/mcp.json
"env": { "SERVICE_TOKEN": "${SERVICE_TOKEN}" }
If you are not using Cursor
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 Cursor checks
Rules with a tested Cursor 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-instructions-directive medium Instruction file tells the agent to bypass its own controls
- agent-marketplace-untrusted medium Repository config adds a third-party plugin or skill source
- 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