New to Claude Skills? Learn how to install them →

trailofbits on GitHub

Trailmark Variant Neighborhood

Free

Expand vulnerabilities into candidate variants for analysis.

Get this skill

Free · Opens the source repo

What Trailmark Variant Neighborhood does

The Trailmark Variant Neighborhood skill is designed to assist security professionals and developers in expanding a confirmed or suspected vulnerability into a comprehensive graph of variant candidates. This skill leverages the relationships between functions, callers, and other code structures to identify potential vulnerabilities that may not be immediately obvious. By analyzing the context around a vulnerability, users can generate a list of review targets that may require further investigation, rather than simply confirming findings.

When a vulnerability is identified, it is crucial to understand its context and potential variants. This skill allows users to explore various dimensions of the codebase, such as shared callers, common sinks, and entrypoint paths, to uncover related functions that might also be vulnerable. The process begins with normalizing and binding the seed issue to a specific node in the Trailmark graph, ensuring that the analysis is grounded in concrete data. Once the seed is established, the skill expands the neighborhood of the graph to identify potential candidates for review.

The skill is particularly useful when the next steps involve variant analysis, static analysis, or manual review. It helps prioritize candidates based on their relevance and potential impact, allowing users to focus their efforts on the most critical areas of the code. By providing a structured approach to identifying and ranking candidates, the Trailmark Variant Neighborhood skill aids in the efficient triage of security issues and enhances the overall security posture of applications.

However, this skill is not suitable for every situation. It should only be used when there is a confirmed seed issue, and the pattern in question is not purely syntactic. For purely syntactic patterns or when the goal is to verify remediation, other tools may be more appropriate. Additionally, the skill is not designed for exploit-chain composition across multiple findings, which requires a different workflow.

When to use it

Use this skill when a vulnerability is confirmed, and you suspect variants exist that depend on call context or shared resources.

When not to use it

Avoid using this skill if no seed issue exists, or if the pattern is purely syntactic and already obvious.

What you can build with it

Identifying Related Vulnerabilities

After discovering a vulnerability in a function, use this skill to find related functions that may also be vulnerable based on shared callers or sinks.

Preparing for Code Review

Before conducting a code review, expand the identified vulnerability to generate a list of candidates that require closer examination.

Enhancing Static Analysis

Leverage the skill to seed static analysis tools with relevant candidates, improving the accuracy of vulnerability detection.

How to install Trailmark Variant Neighborhood

View source

1. Install with the skills CLI

npx skills add trailofbits/skills/trailmark-variant-neighborhood --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by trailofbits

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

RationalizationWhy It Is WrongRequired Action
"Nearby code means variant"Proximity is only a candidate reasonRank it as a review target
"Only exact same names matter"Variants often share sinks or preconditions, not namesExpand across callers, callees, interfaces, and types
"Every candidate is a finding"This skill outputs candidates for reviewAvoid vulnerability claims
"Unreachable candidates can be ignored completely"They may become reachable after refactorsRank lower or list as deferred
"Graph candidates replace semantic pattern work"Graph structure finds locations, not root-cause semanticsHand 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:

  • 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. 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. 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

Frequently asked questions about Trailmark Variant Neighborhood

Similar skills