Research & Analysis🌐universal
trailmark-variant-neighborhood
plugins/trailmark/skills/trailmark-variant-neighborhood/SKILL.md
Expands one confirmed or suspected vulnerability into a Trailmark graph neighborhood of variant candidates by finding sibling functions, shared callers and callees, common sensitive sinks, common entrypoint paths, interface implementations, override relationships, type/reference neighbors, and structurally similar nodes. Use after one issue is found to seed variant-analysis, semgrep-rule-creator, static-analysis, or manual review with graph-derived candidate locations.
Quick Start
Install this SKILL.md
npx skills add https://github.com/trailofbits/skills/tree/main/plugins/trailmark/skills/trailmark-variant-neighborhood--- name: trailmark-variant-neighborhood description: "Expands one confirmed or suspected vulnerability into a Trailmark graph neighborhood of variant candidates by finding sibling functions, shared callers and callees, common sensitive sinks, common entrypoint paths, interface implementations, override relationships, type/reference neighbors, and structurally similar nodes. Use after one issue is found to seed variant-analysis, semgrep-rule-creator, static-analysis, or manual review with graph-derived candidate locations." allowed-tools: - Bash - Read - Grep - Glob - Write --- # Trailmark Variant Neighborhood Expand one seed issue into graph-derived variant candidates. This skill generates review targets, not confirmed findings. ## When to Use - A finding is confirmed or plausible and variants may exist - The vulnerable pattern depends on call context - The issue involves a shared sink, source, validator, interface, override, trait, hook, handler, adapter, or critical type - The next step is to seed `variant-analysis`, `semgrep-rule-creator`, `static-analysis`, or manual review ## When NOT to Use - No seed issue exists. Use discovery or triage first. - The pattern is purely syntactic and already obvious. Use `semgrep-rule-creator` directly. - The question is exploit-chain composition across multiple findings. Use a composition workflow. - The goal is remediation verification. Use a remediation-review workflow. - The seed cannot be bound to a graph node. ## Rationalizations to Reject | Rationalization | Why It Is Wrong | Required Action | |---|---|---| | "Nearby code means variant" | Proximity is only a candidate reason | Rank it as a review target | | "Only exact same names matter" | Variants often share sinks or preconditions, not names | Expand across callers, callees, interfaces, and types | | "Every candidate is a finding" | This skill outputs candidates for review | Avoid vulnerability claims | | "Unreachable candidates can be ignored completely" | They may become reachable after refactors | Rank lower or list as deferred | | "Graph candidates replace semantic pattern work" | Graph structure finds locations, not root-cause semantics | Hand off to variant-analysis, Semgrep, CodeQL, or manual review | ## Workflow ``` Variant Neighborhood Progress: - [ ] Step 1: Normalize and bind the seed - [ ] Step 2: Expand graph neighborhoods - [ ] Step 3: Rank candidates - [ ] Step 4: Extract variant pattern guidance - [ ] Step 5: Emit handoff packet ``` ### Step 1: Normalize And Bind The Seed Accept finding text, file/line, function name, or output from `trailmark-finding-triage`. Bind the seed to a Trailmark node and record the root cause in plain language. If the seed has no concrete graph binding, stop before inventing variants. ### Step 2: Expand Neighborhoods Use the dimensions in [references/neighborhood-patterns.md](references/neighborhood-patterns.md): - shared callers - shared callees and sinks - entrypoint path neighbors - interface, override, trait, and implementation siblings - file or module cluster neighbors - taint or privilege-boundary peers - type and state-reference neighbors Bound expansion to avoid candidate floods. ### Step 3: Rank Candidates Rank with [references/ranking.md](references/ranking.md). Prioritize entrypoint-reachable, tainted, boundary-adjacent, high-blast-radius, shared sink, same-interface, and close-distance candidates. Penalize test, mock, generated, vendor, unreachable, and trusted-internal-only candidates. ### Step 4: Extract Pattern Guidance Summarize what should be searched for syntactically and what requires semantic review. Identify whether follow-up belongs in: - `variant-analysis` - `semgrep-rule-creator` - `static-analysis` with CodeQL or SARIF-producing tools - manual review ### Step 5: Emit Handoff Packet Use [references/output-format.md](references/output-format.md). Include ranked candidates, inclusion reasons, exclusions, limitations, and the variant-analysis handoff. ## Stop Conditions - No graph binding exists - Candidate count is too high and the root cause is underspecified - Trailmark cannot analyze the target language - The seed is only in test, generated, or vendor code and the user did not say that code is in scope
Repository
7.5kstars
643forks
Details
Related Skills
More research & analysis skills you might like
pr-improver
Research & AnalysisRuns an autonomous review-and-fix improvement loop over the current branch's changes until a PR review comes back clean, scoped mechanically to the directories the branch touched. Reviews are performed by an installed PR-review skill (default: pr-review-toolkit's review-pr). Use to fix review findings on a branch before opening or updating a pull request ('clean up this branch', 'fix this PR until review passes', 'run review-and-fix on my changes'). NOT for a one-time review — run the PR-review skill directly.
🤖claude🌐universal
7.5k
643
View
code-improver
Research & AnalysisRuns an autonomous review-and-fix improvement loop over any code target — a skill, plugin, module, or directory — using a reviewer the user names: any installed skill or agent. Keeps a cross-round findings ledger, escalates when fixes stop converging, and guards scope mechanically. Use when asked to 'improve this code until review passes', 'run an improvement loop with <reviewer>', or to iterate review-and-fix with a specific reviewer. For skills prefer the skill-improver entry; for a branch prefer pr-improver.
🤖claude🌐universal
7.5k
643
View
skill-improver
Research & AnalysisRuns an autonomous review-and-fix improvement loop over a Claude Code skill until a review comes back clean, with a cross-round findings ledger, escalation when fixes stop converging, and a mechanical scope guard. Reviews are performed by the plugin-dev skill-reviewer agent. Use to fix skill quality issues, iteratively refine a skill, or resume a loop after an escalation ('fix my skill', 'improve this skill until it passes review', 'skill improvement loop'). NOT for a one-time review — use the plugin-dev skill-reviewer agent directly.
🤖claude🌐universal
7.5k
643
View
audit-augmentation
Research & AnalysisAugments Trailmark code graphs with external audit findings from SARIF static analysis results, weAudit annotation files, and version-gated Trailmark 0.4.x binary-analysis graph exports. Maps findings to graph nodes by file and line overlap, creates severity-based subgraphs, and enables cross-referencing findings with pre-analysis data (blast radius, taint, etc.). Use when projecting SARIF results onto a code graph, overlaying weAudit annotations, importing binary graph findings, cross-referencing Semgrep, CodeQL, or binary-analysis findings with call graph data, or visualizing audit findings in the context of code structure.
🌐universal
7.5k
643
View