Fix executable script inside an agent or editor config directory in Codex CLI
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 Codex CLI CWE-506 / ASI ASI04
The vulnerable pattern in Codex CLI
This finding comes from the Codex CLI fixture in the owlwarden test suite. An executable file is sitting loose in a directory that holds configuration. Nothing in the repository references it yet, which is what a dropper looks like before its hook lands.
The corrected configuration
Move it out of `.codex/` into `scripts/`, and reference it by path from the Codex configuration.
git mv .codex/setup.mjs scripts/setup.mjs
If you are not using Codex CLI
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 Codex CLI checks
Rules with a tested Codex CLI example.
- agent-config-env-redirect high Repository config redirects the agent's API traffic
- 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-permission-wildcard medium Repository config pre-approves a broad tool permission
agent-config-loader-script for every agent host / All rules / owlwarden