codex-plugin-cc
- Type
- Plugin
- Scanned
- Nov 21, 2026
- Version
- db52e28f4d9d
- Files read
- 62
This plugin lets Claude Code users run OpenAI Codex code reviews, delegate coding tasks, and transfer sessions through their local Codex CLI. Its biggest risks are that model-invocable commands pre-approve broad node and npm execution that prompt injection could abuse, and on Windows it runs commands through cmd.exe inside the repository folder where a malicious .cmd file would execute automatically.
What it can reach
- Files
- Reads git diffs, status, and untracked files in the repository, reads Claude transcripts under ~/.claude/projects and Codex import ledgers under ~/.codex, writes job logs and state under CLAUDE_PLUGIN_DATA or the system temp folder, and edits workspace files when Codex runs in write mode.
- Shell commands
- Executes git, node, npm, codex, and process-termination commands locally, and delegates tasks to codex app-server which can run shell commands inside the workspace.
- Network
- Sends prompts, diffs, and imported transcripts through the local codex app-server to OpenAI or the configured model provider, and listens on a local Unix socket or Windows named pipe for its shared session broker.
- Secrets
- Uses the user's local Codex CLI login or API key configuration and passes current environment variables to spawned child processes.
- System
- Spawns detached background worker and broker processes and terminates process trees by PID when cancelling jobs or ending a session.
Findings
-
HighWindows shell execution searches the repository folder before PATH
plugins/codex/scripts/lib/process.mjs:12
On Windows, both process.mjs (when checking node, npm, codex, or running taskkill) and app-server.mjs (when launching codex app-server) spawn commands with shell set to true and the working directory set to the target repository. In Command Prompt and PowerShell environments where SHELL is unset, Node invokes cmd.exe, which searches the current working directory before PATH. Opening or checking out an untrusted repository or pull request containing a codex.cmd, node.cmd, or npm.cmd file and running a read-only /codex:review, /codex:setup, or the stop hook will execute the attacker's script.
Fix: Resolve the absolute executable path from PATH (for example with where.exe or PATH lookup) before spawning, or spawn node.exe and .exe binaries with shell: false and a neutral working directory for availability checks.
-
HighModel-invocable commands pre-approve arbitrary node and npm commands
plugins/codex/commands/setup.md:4
Unlike the review, status, result, cancel, and transfer commands, setup.md and rescue.md do not set disable-model-invocation: true, meaning the AI agent can invoke them on its own via the Skill tool. Their frontmatter grants allowed-tools: Bash(node:*) and Bash(npm:*), which pre-approves any node or npm command rather than only the plugin helper script, and setup.md also interpolates $ARGUMENTS unquoted into a shell command. If untrusted text in an issue, webpage, or file tricks Claude via prompt injection into invoking these skills, it can run arbitrary code with node -e or npm without user confirmation.
Fix: Add disable-model-invocation: true to setup.md, quote "$ARGUMENTS", and restrict allowed-tools in both setup.md and rescue.md to the exact codex-companion.mjs command path instead of Bash(node:*) and Bash(npm:*).
-
MediumSingle-argument task parsing allows flag injection from inside prompt text
plugins/codex/scripts/codex-companion.mjs:136
The runtime skill instructs the rescue subagent to pass all task arguments as a single quoted string, and any read-only task call with one prompt argument also hits normalizeArgv when argv.length === 1. normalizeArgv splits that single string on whitespace and quotes, and parseArgs continues parsing flags anywhere in the text instead of stopping at the first positional word. If untrusted text pasted or forwarded into a read-only task prompt contains tokens such as --write, -C <dir> (aliased to --cwd), or --prompt-file <path>, the script treats them as real flags—upgrading a read-only run to workspace-write, moving Codex's writable root outside the repository (such as to the home directory), or reading an arbitrary local file as the prompt.
Fix: Pass CLI flags as separate argv elements followed by -- before the prompt text, stop option parsing at the first positional token, and remove automatic splitting of single-element argv arrays for task prompts.
-
MediumHardcoded approvalPolicy "never" overrides the user's Codex safety configuration
plugins/codex/scripts/lib/codex.mjs:67
The README states that the plugin applies the user's existing local Codex configuration. However, buildThreadParams and buildResumeParams hardcode approvalPolicy to "never" on every thread start and resume call, overriding any stricter approval_policy (such as untrusted or on-request) configured in ~/.codex/config.toml. Combined with the codex-rescue subagent proactively delegating tasks in --write (workspace-write) mode by default, Codex can edit repository files and run workspace commands without confirmation prompts.
Fix: Leave approvalPolicy unset when starting or resuming threads unless explicitly configured so user settings apply, or clearly document that delegated runs bypass Codex approval prompts and default rescue diagnosis runs to read-only.
-
MediumFallback temp state directory uses a predictable path and default file permissions
plugins/codex/scripts/lib/state.mjs:10
When CLAUDE_PLUGIN_DATA is not set in the environment, state, job logs, review outputs, and broker connection files are stored under a fixed path in the shared system temp directory (/tmp/codex-companion) using default directory and file permissions. Under a standard 0022 umask on multi-user Unix systems, other local users can read job logs, code diffs, and prompts, or pre-create /tmp/codex-companion with permissive permissions to tamper with broker.json (redirecting Codex connections) or stored job requests executed by background workers.
Fix: Store fallback state inside the user's home directory (for example ~/.claude or ~/.cache with mode 0o700) and write state, log, and broker files with mode 0o600 after verifying directory ownership.
-
LowUntracked symlinks are followed and uploaded during adversarial reviews
plugins/codex/scripts/lib/git.mjs:201
When collecting working-tree context for /codex:adversarial-review, formatUntrackedFile uses fs.statSync and fs.readFileSync on each untracked path instead of checking fs.lstatSync first. Unlike git diff, which never dereferences symlinks, this follows untracked symlinks to files outside the repository (up to 24 KB of text) and includes their contents in the review prompt sent to the model provider.
Fix: Use fs.lstatSync(absolutePath) and skip any entry where stat.isSymbolicLink() is true, or record only the symlink target path rather than reading the target file.
