/security-agent-skills:hunting-bug-variantsfrom security-agent-skills
Given one confirmed vulnerability, systematically finds sibling defects with the same structural shape elsewhere in the codebase, including copy-paste clones, sibling handlers, and incomplete fixes.
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.
One bug is almost never alone. The same mistake gets copy-pasted, re-implemented by a second author, or left uncovered by a fix that only patched the reported call site. Variant hunting takes a single confirmed defect and turns it into a signature you can sweep the whole codebase with, so you find the three other copies before an attacker does.
Authorized source only (your own, OSS, CTF, in-scope engagement). If you can't name the authorization, stop.
Anchor the seed. State the confirmed defect precisely: the exact sink, the exact missing or wrong step (no bounds check, no authz check, unnormalized path, unescaped context), and the untrusted input that drives it. A vague seed ("there was an injection somewhere") produces a useless sweep.
Extract the shape, not the string. Abstract the seed into a structural
signature that survives renaming and reformatting. Usually one of: this sink
called without that guard; this unsafe idiom (raw concat into a query,
base / user_name without resolve-and-contain); this type of value reaching
this argument. Grepping the literal code finds only exact copies; the shape
finds the re-implementations.
Sweep for same-shape sites. Enumerate every place matching the signature: other callers of the same sink, other functions with the same step missing, copy-paste clones, sibling handlers in the same module, the same pattern in a different subsystem. Cast wide here; ranking is triage, not a filter.
Check the fix itself for gaps. If the seed came with a patch, treat the fix as suspect: does it cover every reachable path to the sink, or only the reported one? Was the check added to the caller but not a second caller? Is there a pre-existing path that bypasses the new check? Incomplete fixes are the highest-yield variants because everyone believes the bug is dead.
Adjudicate each candidate. A same-shape site is a lead, never a verdict. Confirm or kill each by tracing input to the sink and reading the hops on live source, exactly as for any lead. A structural twin can still be safe because a caller bounds the input or a guard sits one frame up.
Record every decision in the schema. Each confirmed variant is its own
finding (its own id, path, evidence). Killed twins are kept with the reason
they differ from the seed, so the next person doesn't re-chase them.
write" is too loose; "the literal three lines from the seed" is too tight.
Aim at "a filesystem write whose path is a user value joined to a base without a
containment check."export." Sweep on the invariant.Seed (confirmed). Path traversal in report export:
name = body['filename']flows toopen(base / name, 'w')with no containment check./etc/x-style input escapesbase.Signature. A filesystem sink whose path is
base / <user value>with no resolve-and-reject-outside-base step between the input and the sink.Sweep surfaces three same-shape sites: backup restore, avatar upload, and log export.
Confirm. Backup restore builds
restore_dir / archive['name']and extracts there with no containment check;../in the archive entry escapes. Confirmed, new finding,high.Kill. Avatar upload builds
base / fnamebut reading the hop showsfnameis a server-generated UUID, never the client's name. Killed,kill_reason= "path component is a generated UUID, not attacker input; the seed's invariant holds here."
The sweep needs a way to enumerate structural matches across the tree from a real parse: every caller of a sink, every function missing a step its peers have, clones of an idiom. A code property graph or a structural-search tool does this; on a small target you read the neighbors by hand. Extraction (step 2) and adjudication (step 5) are human judgment the tool only feeds.
auditing-guard-gaps - when the seed's invariant is specifically a missing
guard and you want the unguarded peers of a guarded function.adjudicating-taint-paths - the confirm/kill loop each candidate goes through.extracting-nday-from-a-patch - when the seed is a patch rather than your own
finding.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.Other plugins' skills for the same job