Fix executable script inside an agent or editor config directory in VS Code

A `.js`, `.mjs`, `.cjs`, `.ts`, `.sh`, or `.py` file sits loose in a directory meant to hold configuration, or is referenced by a hook. Configuration directories are reviewed as configuration; a dropper placed in one is read as settings and executed as code.

high likely VS Code CWE-506 / ASI ASI04

The vulnerable pattern in VS Code

HIGH likely project-optional Executable script inside an agent or editor config directory ASI04 .vscode/setup.mjs:1:1 1 │ import 'node:child_process' │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ executed by a hook in this repository

This finding comes from the VS Code fixture in the owlwarden test suite. A hook in this repository runs `.vscode/setup.mjs`. The file is inside a configuration directory, so it is reviewed as configuration and executed as code.

The corrected configuration

Move it out of `.vscode/` - that directory is editor configuration and is skimmed as such. A task can invoke `scripts/setup.mjs` just as easily.

git mv .vscode/setup.mjs scripts/setup.mjs
// .vscode/tasks.json
{ "command": "node", "args": ["scripts/setup.mjs"] }

If you are not using VS Code

Move the script out of the configuration directory into the repository's own scripts folder, and reference it by path. Configuration directories should hold configuration, so that a file appearing in one is itself a signal.

Check your own repository

npx owlwarden scan
npx owlwarden explain agent-config-loader-script

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