os-command-injection

A security review for OS command injection, a flaw where user input changes a command sent to the operating system.

In plain words
What is it for?
Reviewing wrappers around converters, scanners, network tools, backups, maintenance scripts, and other external programs.
Why use it?
It helps find code that could let an attacker run their own commands with the application's permissions.

Skill for Claude CodeCodex

Part of the websec plugin — 36 skills, 2 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/emre-guler/websec/os-command-injection
Any agent
npx skills add emre-guler/websec --skill os-command-injection
Clone the repo
git clone --depth 1 https://github.com/emre-guler/websec

Made for: Claude Code, Codex.

Or install websec, the plugin that ships this one along with the rest of its 36 skills, 2 agents.

Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,207 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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 $0.00078 $0.05207
Opus 5 $0.00039 $0.02603
Sonnet 5 $0.00016 $0.01041
Haiku 4.5 $0.00008 $0.00521

Measured 2d ago against content hash 5a3e11c95b13, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

os-command-injection scanned grade A 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 2d 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.

Makes network callslowCapability

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

- **Server-side request forgery** (`/websec:ssrf`): the server is made to issue a network request. Test: is the sink an HTTP client, or a shell? A URL passed to a shelled-out `curl` is command injection; the same URL pas

Runs shell commandslowCapability

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

| Node | `child_process.exec`, `execSync`, `spawn`/`spawnSync`/`execFile` with `{shell:true}`, template literals inside any of them | `req.query`/`req.body`/`req.params`, uploaded filename, or a stored value placed into
skills/os-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.

OS Command Injection Detection

Overview

OS command injection is a server-side flaw in which an application builds an operating-system command that incorporates untrusted input and hands it to a shell, letting the attacker end the intended command and append their own. It sits wherever request data flows into a process invocation: a converter called on an uploaded file, a diagnostic tool run against a supplied host, a report generator, a scheduled maintenance script fed a stored value. The attacker is typically a remote user, often unauthenticated, who supplies shell metacharacters inside a parameter the developer assumed would be a filename, an identifier, or a menu choice. Because the injected command runs with the privileges of the application process, success means reading and writing every file that user can touch, harvesting credentials and cloud tokens, pivoting to internal systems, and planting persistence — this is the class with the least distance between a single unsafe line and full host compromise. This skill finds it by locating every process invocation that carries a dynamic string, checking each site in parallel, and merging the results into <output_dir>/os-command-injection-results.md.

What it is NOT

  • Template injection (/websec:ssti): the attacker's payload is evaluated by a template engine inside the language runtime, not by a shell. Test: is the sink a render or compile call, or a process launch? Both can end in code execution; the sink and the fix differ.
  • Unsafe deserialization (/websec:deserialization): execution comes from reconstructing an object graph, not from spawning a process. Test: is there an exec call on the path at all?
  • Server-side request forgery (/websec:ssrf): the server is made to issue a network request. Test: is the sink an HTTP client, or a shell? A URL passed to a shelled-out curl is command injection; the same URL passed to an HTTP library is SSRF.
  • Path traversal (/websec:path-traversal): a path parameter reaches a file read or write and nothing is executed. Test: does anything run, or is a file merely opened? If the traversal only selects which binary a launcher runs, note it here and say so.
  • File upload (/websec:file-upload): storing an executable in a served directory is that class; passing an attacker-influenced filename into a shell command is this one. The two chain often — record the chain in Impact.
  • Not a finding: a command whose every argument is a constant or a server-generated value; an argv-array exec with the shell disabled and validated arguments; a command string built from an enum the request only selects an index into; commands in build scripts, developer tooling, and test helpers that no request reaches.

Read the full file on GitHub · 154 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. 2d ago First seen · 154 lines · 78 tokens per session scan A 5a3e11c95b13

Subscribe to this mod's changes

os-command-injection is a skill published in the GitHub repository emre-guler/websec (2 stars, last pushed 6d ago), licensed MIT. It adds 78 tokens to every session and 5,207 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

vantage

Autonomous, artifact-driven SAST (Static Application Security Testing) for web AND mobile app repositories, plus optional code-level remediation. Use whenever the user asks to security-review, pentest, audit, or scan a codebase for vulnerabilities — web (SQLi, XSS, IDOR/BOLA, auth bypass, SSRF, XXE, hardcoded secrets…

tinoimammp/vantage-security-agent · 230 tokens

prowler-compliance

Creates, syncs, audits and manages Prowler compliance frameworks end-to-end. Covers the two supported JSON schemas (universal multi-provider and legacy per-provider), the SDK model tree (legacy attribute classes, universal ComplianceFramework, ConfigRequirements guardrails), output formatters (legacy per-framework +…

prowler-cloud/prowler · 227 tokens

prowler-ui

Prowler UI-specific patterns. For generic patterns, see: typescript, react-19, nextjs-16, tailwind-4. Trigger: When working inside ui/ on Prowler-specific conventions (shadcn, folder placement, actions/adapters, shared types/hooks/lib).

prowler-cloud/prowler · 64 tokens

prowler-pr

Creates Pull Requests for Prowler following the project template and conventions. Trigger: When working on pull request requirements or creation (PR template sections, PR title Conventional Commits check, changelog gate/no-changelog label), or when inspecting PR-related GitHub workflows like conventional-commit.yml…

prowler-cloud/prowler · 84 tokens

prowler-test-api

Testing patterns for Prowler API: JSON:API, Celery tasks, RLS isolation, RBAC. Trigger: When writing tests for api/ (JSON:API requests/assertions, cross-tenant isolation, RBAC, Celery tasks, viewsets/serializers).

prowler-cloud/prowler · 62 tokens

prowler-ci

Helps with Prowler repository CI and PR gates (GitHub Actions workflows). Trigger: When investigating CI checks failing on a PR, PR title validation, changelog gate/no-changelog label, conflict marker checks, secret scanning, CODEOWNERS/labeler automation, or anything under .github/workflows.

prowler-cloud/prowler · 67 tokens