command-injection

command-injection is a skill for Claude Code, Codex from ByamB4/find-cve-agent. It costs 24 tokens per session (1,283 once invoked), scanned B, original, Apache-2.0.

A security checker for OS command injection, where user-controlled input reaches a system command and changes what the operating system runs.

In plain words
What is it for?
Use it to audit packages that call command-line tools or external programs for builds, file processing, Git, FFmpeg, ImageMagick, Pandoc, and similar tasks.
Why use it?
It helps separate full command injection from argument injection and identify unsafe use of shell execution, which may allow unintended commands to run.

Skill for Claude CodeCodex

Part of the find-cve-agent plugin — 21 skills, 7 commands, 5 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/byamb4/find-cve-agent/command-injection
Any agent
npx skills add ByamB4/find-cve-agent --skill command-injection
Clone the repo
git clone --depth 1 https://github.com/ByamB4/find-cve-agent

Made for: Claude Code, Codex.

Or install find-cve-agent, the plugin that ships this one along with the rest of its 21 skills, 7 commands, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for command-injection

README.md
[![agentmods](https://agentmods.dev/badge/skills/byamb4/find-cve-agent/command-injection.svg)](https://agentmods.dev/skills/byamb4/find-cve-agent/command-injection)
Your own site
<a href="https://agentmods.dev/skills/byamb4/find-cve-agent/command-injection"><img src="https://agentmods.dev/badge/skills/byamb4/find-cve-agent/command-injection.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,283 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.01283
Opus 5 $0.00012 $0.00642
Sonnet 5 $0.00005 $0.00257
Haiku 4.5 $0.00002 $0.00128

Measured 5d ago against content hash 3410d7967eb2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade B, and why

command-injection scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **Command injection**: Attacker breaks out of the intended command entirely (`; rm -rf /`)

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

# JavaScript/TypeScript — look for child_process usage
skills/command-injection/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Command Injection Detection

When to Use

Audit any package that wraps CLI tools, runs build commands, processes files via external programs, or interfaces with git/ffmpeg/imagemagick/pandoc/etc.

CVSS is typically CRITICAL 9.8 for confirmed RCE.

Key Distinctions

Command Injection vs Argument Injection

  • Command injection: Attacker breaks out of the intended command entirely (; rm -rf /)
  • Argument injection: Attacker adds flags to the intended command (--upload-pack=malicious)
  • Both are reportable. Command injection is CRITICAL, argument injection is HIGH.

Shell vs No-Shell Execution

  • Shell execution (exec, system, os.popen): Command string passed to shell interpreter. Metacharacters (;, |, &&, backticks, $()) are interpreted. DANGEROUS.
  • Direct execution (execFile, spawn without shell, subprocess with list args): Arguments passed directly to the program. No shell interpretation. SAFER but argument injection may still work.

Process

Step 1: Find Shell Execution Sinks

# JavaScript/TypeScript — look for child_process usage
grep -rn "child_process" .
grep -rn "\.exec\('" .
grep -rn "\.execSync\(" .
grep -rn "spawn.*shell.*true" .
grep -rn "shelljs" .

# Python
grep -rn "os\.system\|os\.popen" .
grep -rn "subprocess.*shell.*True" .
grep -rn "commands\.getoutput\|commands\.getstatusoutput" .

# Go
grep -rn 'exec\.Command.*"bash"\|exec\.Command.*"sh"' .

# Ruby
grep -rn "system(\|%x{" . --include="*.rb"
grep -rn "IO\.popen\|Open3" .

# PHP
grep -rn "system(\|passthru(\|shell_exec(\|popen(" .
grep -rn "proc_open\|pcntl_exec" .

Step 2: Trace User Input to Sink

For each sink:

  1. What command string is constructed?
  2. Is any part from user input (HTTP params, filenames, config values)?
  3. Is the user input interpolated into a shell string or passed as an argument array?

Step 3: Check Sanitization

grep -rn "escapeshellarg\|escapeshellcmd\|shlex\.quote\|shellescape" .
grep -rn "sanitize\|escape\|clean\|validate" .

Read the full file on GitHub · 154 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 154 lines · 24 tokens per session scan B 3410d7967eb2

Subscribe to this mod's changes

command-injection is a skill published in the GitHub repository ByamB4/find-cve-agent (47 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 24 tokens to every session and 1,283 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (recursive force delete, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories