/security-agent-skills:hunting-os-command-injectionfrom security-agent-skills
Hunts OS command injection where untrusted input reaches a shell-interpreted process-spawning API. Covers system calls, shell-mode spawns, and indirect shells via wildcards, subshells, environment values, or attacker-influenced PATH/IFS.
Ships in security-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Command injection happens when untrusted input reaches a process-spawning API in a way that lets a shell interpret it. A shell treats characters like the semicolon, the pipe, the ampersand, backticks, and dollar parentheses as syntax, so an input that carries them can chain, substitute, or replace the intended command. The single fact that decides whether the class exists is whether a shell is in the loop: a call that composes a string and hands it to a system shell is injectable, while a direct exec that passes a fixed program and a separate argument vector, with no shell, is not, because the arguments are delivered as data. You find command injection by locating every spawn, deciding whether it goes through a shell, and tracing whether untrusted input reaches the command portion of a shell-interpreted call.
Test command injection only against systems you own or are authorized to assess, on non-production hosts, because a confirmed case runs commands on the server. Prove the class with an inert, side-effect-free command (an echo or a fixed delay) rather than anything destructive, and stay within the authorized host. If you can't name the authorization, stop.
Establish whether a shell is in the loop first. For each spawn, determine whether it invokes a shell (a system-style call, a shell-mode flag, or a single composed command string) or is a direct exec with a fixed program and a separate argument vector. This is the false-positive killer: a shell-less exec does not interpret metacharacters, so untrusted arguments there are not command injection, even though they may be argument injection, a separate concern. Name the spawn mode before judging the input.
Trace untrusted input to the command portion. Follow request parameters, headers, filenames, and stored fields into the spawn, and identify whether the input lands in the command itself or only in an argument. Input concatenated into a shell command string is the vector; confirm it is attacker-controlled and not fully fixed by the code.
Check for indirect shells and interpretation. A spawn can reach a shell indirectly: a program that itself invokes a shell, a wildcard the shell expands, a value substituted from the environment, or a nested command. Determine whether any layer between the input and execution interprets the string, not just the outermost call.
Examine the environment, PATH, and IFS. Even a shell-less exec can be steered if the attacker controls the environment or the working directory: a relative program name resolved through an attacker-influenced PATH, or field splitting driven by IFS, can change what runs. Check whether the spawn pins an absolute program path and a controlled environment.
Read the neutralization that would hold. Determine whether the code avoids the shell entirely by using an argument-vector exec with a fixed program, whether any user value in a shell context is quoted and escaped by a real shell-quoting routine, and whether an allowlist constrains the command to a fixed set. Note that allowlisting the program while interpolating arguments into a shell does not close the class.
Confirm and record. Confirm by injecting an inert marker (an echoed token or a bounded delay) through the input and observing the shell interpret it on an authorized host. Kill the lead if the spawn is a shell-less exec with a fixed program and the input is only a data argument, if a real shell-quoting or allowlist neutralizes every user value in a shell context, or if the input never reaches the command. Record the input, the spawn call and its mode, the interpreting layer, and the neutralization state.
Confirm. An export feature builds a command string that includes a user-supplied filename and passes it to a system shell call. A filename containing a command separator and an inert echoed token is interpreted by the shell, and the token appears in the output, proving execution. Confirmed OS command injection,
critical, remediation = replace the shell call with an argument-vector exec of a fixed program, pass the filename as a separate argument, and validate it against an allowlist of permitted names.Kill. The same feature spawns a fixed absolute program with an argument vector and no shell, passes the filename as one element of that vector, pins the environment and PATH, and validates the name. A filename with separators is delivered verbatim as a single argument and never interpreted. Killed,
kill_reason= "spawn is a shell-less exec of a fixed absolute program with the input as a data argument, environment and PATH pinned; no shell interprets the value."
You need every spawn in the code, its mode (shell versus argument-vector exec), whether untrusted input reaches the command portion, and the environment and PATH the spawn runs with. For each shell-mode spawn, decide whether input reaches the command and whether quoting or an allowlist neutralizes it; for shell-less spawns, check the program path and environment. Reading the spawn call shows the mode; an inert echoed marker or a bounded delay through the input shows whether a shell interprets it.
hunting-command-argument-and-flag-injection - the distinct sibling for shell-less spawns, where an
untrusted value becomes an option or flag rather than a chained command.hunting-scheduled-job-and-search-path-hijacks - the environment and PATH angle in depth, where a
writable path element changes what a spawned program resolves to.hunting-dynamic-linker-hijacks - a related environment-driven hijack where loader variables change what a
binary executes.adjudicating-taint-paths - use it to prove input reaches the command portion of a shell-interpreted call.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub unboundcompute/security-agent-skills --plugin security-agent-skills194 skills in this plugin
/adjudicating-dependency-cve-reachabilityDecide whether a CVE in a dependency actually exposes your application before you scramble to patch: is the vulnerable function on a real call path from your code, do the trigger preconditions hold, and can an attacker control the input that reaches it. Use when an advisory, SCA scan, or dependency bot flags a CVE and you must separate a genuine exposure from unreachable noise, or justify why you are or are not affected. Covers pinning the vulnerable symbol, call-path reachability, precondition checks, and taint from your entry points./adjudicating-taint-pathsDecide whether a whitebox lead is a real bug by tracing taint from an untrusted source to a dangerous sink and confirming every hop against live source. Use after a scanner, a candidate list, or your own reading surfaces a "this looks dangerous" sink (SQL exec, system/exec, file open, deserialize, template render, redirect target, memcpy) and you must decide whether attacker- controlled input actually reaches it - or kill the lead with evidence. Covers forward and reverse taint, witness paths, sanitizer analysis, and the evidence rules that separate a finding from a false positive./auditing-account-abstraction-and-paymaster-trustAudit an ERC-4337 account-abstraction deployment for trust misplaced in the user-operation lifecycle: a smart account whose validation accepts a signature or nonce it should reject, a paymaster that agrees to sponsor gas for operations it should not so an attacker drains its deposit, a bundler or entry-point assumption that lets a user operation be replayed or reordered for gain, and validation logic that reads mutable state or reaches outside its allowed scope. Covers smart-contract wallets, paymasters, bundlers, and the entry point in an account-abstraction stack where a user operation is validated and sponsored before it executes. Use when a user operation is validated, paid for, and executed by separate parties and that trust split is the boundary. The crafted user operation is the source, the drained paymaster or unauthorized execution is the sink, and the over-permissive validation or sponsorship rule is the bug./auditing-account-recovery-and-reset-trustAudit password reset and account recovery flows for the trust that lets an attacker take over an account: a reset token that is guessable, long-lived, reusable, or not bound to the account it was issued for, a recovery path that verifies a weaker factor than login and bypasses multi-factor, a reset link whose host comes from an attacker-controllable header so the token leaks, and a recovery that trusts an unverified email or phone change to redirect the reset. Covers the recovery surface of authentication systems, where resetting a credential or recovering access is the alternate door into an account. Use when an application offers password reset or account recovery and that flow is a path to authentication. The attacker-driven recovery request is the source, the account it takes over is the sink, and the weak token, bypassed factor, or leaked reset link that grants it is the bug./auditing-admission-control-policy-gapsAudit cluster admission control for gaps that let a non-compliant or hostile workload through: a validating webhook that fails open when its backend is unreachable, a policy that scopes by namespace or label and misses the namespaces that matter, a mutating webhook whose changes are trusted downstream, and an ordering or exemption that lets a privileged pod bypass the checks meant to stop it. Covers Kubernetes admission webhooks and policy engines that are supposed to enforce workload security at create and update time. Use when admission policies are the control that keeps privileged, unsigned, or over-permissioned workloads out of the cluster. The workload submitted for admission is the source, the admitted resource is the sink, and the policy gap that let it through is the bug./auditing-ai-agent-permissionsAudit what an AI agent is actually allowed to do versus what its task needs. Covers excessive agency (tools, scopes, and autonomy beyond the job), missing human-in-the-loop gates on irreversible actions, over-broad credentials and their blast radius, sandbox and code-interpreter escape, unfiltered egress, and unbounded resource or spend (denial-of-wallet). Use when granting an agent a tool or scope, reviewing an agent's permission posture, or deciding which actions need approval. The model's restraint is not a control; permissions are.Other plugins' skills for the same job