Executable script inside an agent or editor config directory
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 agent workspace ASI ASI04 / CWE-506
What it looks like
From .claude/setup.mjs in the fixture suite.
The fixture test asserts this finding.
How to fix it
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.
git mv .claude/setup.mjs scripts/setup.mjs
The fix for your agent host
Choose the configuration format used by your host.
Check your own repository
npx owlwarden scan --preset deep
npx owlwarden explain agent-config-loader-script
explain prints the rule and fixes in the terminal. It does not
use the network.
Related rules
- agent-config-env-redirect high Repository config redirects the agent's API traffic
- agent-config-secret-reachable high Repository config puts credentials in reach of a repository-controlled command
- 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