/security-agent-skills:hunting-command-argument-and-flag-injectionfrom security-agent-skills
Hunts argument/flag injection in shell-less subprocess spawns where untrusted input in argv is parsed as an option rather than data. Covers dash-prefixed values and positional layout bugs that bypass metacharacter defenses.
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.
Argument injection lives in the safe-looking case: a program is spawned without a shell, as a fixed binary with a separate argument vector, so there is no metacharacter interpretation and command injection does not apply. The bug is that the target program parses its own arguments, and an attacker-controlled value placed in the vector can be read as an option rather than as data. A value that begins with a dash becomes a flag; a value inserted where the program has not yet seen the options-terminator can turn on a behavior the caller never intended, writing to a file, reading one, executing an embedded command, changing an output or a protocol, or contacting a network host. Because there is no shell, defenses aimed at metacharacters do nothing. You find it by locating shell-less spawns whose argument vector includes untrusted values and asking whether the target can parse those values as options.
Test argument injection only against systems you own or are authorized to assess, on non-production hosts, because a confirmed case makes a real tool take an unintended action. Prove the class with an inert option whose effect is observable but harmless, and stay within the authorized host. If you can't name the authorization, stop.
Establish that input can occupy an option slot first. For each shell-less spawn, determine whether an
untrusted value can start with a dash, or be positioned in the vector before the program has seen an
options terminator, so the target parses it as an option rather than an operand. This is the
false-positive killer: a value pinned after a -- terminator, or in a fixed operand position the program
treats as data, cannot become a flag. Confirm the value can reach an option-parsed slot before going on.
Identify the target program and its dangerous options. Name the spawned tool and read, generically, which of its options change behavior in a security-relevant way: writing output to an arbitrary path, reading or including a file, executing a subcommand or hook, changing the destination or protocol, or loading a config. The impact is defined by what options the specific tool exposes.
Trace the untrusted value into the vector. Follow the request or stored input into the exact argv element it becomes, and confirm the code does not sanitize a leading dash, reorder operands, or insert a terminator. A value that the caller believes is a filename or a search term, placed directly into the vector, is the vector.
Check the options-terminator and positional layout. Determine whether the spawn inserts a --
terminator before untrusted operands and whether the tool honors it, and whether the layout fixes
untrusted values in positions the tool treats as data. A missing terminator, or a tool that keeps parsing
options after operands, leaves the slot exploitable.
Assess reachable impact for this tool. From a value that can be an option, determine what it actually enables for the target: an arbitrary-write flag, a file-read or include flag, a command-execution or hook option, or a network or protocol switch. This is where severity is decided; assess it from the tool's option surface, not by launching destructive flags.
Confirm and record. Confirm by supplying a value that a benign, observable option would trigger (an
output written to an allowed location, a version banner, a bounded delay) through the input on an
authorized host, showing the tool parsed it as an option. Kill the lead if the spawn inserts a --
terminator the tool honors before untrusted operands, if the value is pinned to a data-only position, if
a leading dash is rejected or neutralized, or if the tool exposes no behavior-changing option. Record the
input, the spawn and target tool, the option the value became, and the reachable effect.
-- before untrusted operands, the tool cannot
tell the caller's data from options.Confirm. A repository feature spawns a fixed version-control binary with a user-supplied ref placed directly in the argument vector and no options terminator. A ref that begins with a dash is parsed by the tool as an option that runs an external helper, and an inert helper that writes an observable marker to an allowed path executes. Confirmed argument injection reaching command execution through a tool option,
high, remediation = insert a--terminator before untrusted operands, reject values beginning with a dash, and fix untrusted values to positions the tool treats as data.Kill. The same spawn places the ref after a
--terminator that the tool honors, validates the ref against an allowlist pattern, and rejects a leading dash. A dash-prefixed ref is delivered as a literal operand and the tool reads it as data. Killed,kill_reason= "spawn inserts an honored options terminator before the untrusted operand and rejects leading dashes; the value cannot be parsed as an option."
You need every shell-less spawn whose argument vector includes untrusted input, the target program and its
behavior-changing options, whether a -- terminator is inserted and honored, and whether leading dashes are
rejected. For each, decide whether the value can reach an option-parsed slot and what option it could become.
Reading the spawn shows the vector layout and terminator; supplying a value that a benign observable option
would trigger shows whether the target parsed it as an option.
hunting-os-command-injection - the sibling for shell-mode spawns, where the bug is metacharacter
interpretation rather than an option parser; this skill covers the shell-less case.hunting-scheduled-job-and-search-path-hijacks - a related spawn-behavior class where the environment and
path, rather than an argument, change what runs.hunting-path-traversal-and-file-access - a frequent impact when the injected option is a read or write
flag pointed at an arbitrary path.adjudicating-taint-paths - use it to prove an untrusted value reaches an option-parsed argv slot.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