SKILL·31D576

trailmark-variant-neighborhood

trailofbits
Updated Yesterday
6,381
549
6,381
View on GitHub
Metaai

About

This skill expands a known vulnerability into a graph neighborhood of potential variant candidates by analyzing code relationships like shared callers, common sinks, and interface implementations. It's designed for use after an initial finding to generate targets for variant analysis, rule creation, or manual review. The output provides derived candidate locations, not confirmed findings, to seed further investigation.

Quick Install

Claude Code

Recommended
Primary
npx skills add trailofbits/skills -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/trailofbits/skills
Git CloneAlternative
git clone https://github.com/trailofbits/skills.git ~/.claude/skills/trailmark-variant-neighborhood

Copy and paste this command in Claude Code to install this skill

Documentation

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

GitHub Repository

trailofbits/skills
Path: plugins/trailmark/skills/trailmark-variant-neighborhood
0
agent-skills
FAQ

Frequently asked questions

What is the trailmark-variant-neighborhood skill?

trailmark-variant-neighborhood is a Claude Skill by trailofbits. Skills package instructions and resources that Claude loads on demand, so Claude can perform trailmark-variant-neighborhood-related tasks without extra prompting.

How do I install trailmark-variant-neighborhood?

Use the install commands on this page: add trailmark-variant-neighborhood to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does trailmark-variant-neighborhood belong to?

trailmark-variant-neighborhood is in the Meta category.

Is trailmark-variant-neighborhood free to use?

Yes. trailmark-variant-neighborhood is listed on AIMCP and free to install.

Related Skills

content-collections
Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill
polymarket
Meta

This skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.

View skill
creating-opencode-plugins
Meta

This skill helps developers create OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It provides the plugin structure, event API specifications, and implementation patterns for JavaScript/TypeScript modules. Use it when you need to intercept, monitor, or extend the OpenCode AI assistant's lifecycle with custom event-driven logic.

View skill
sglang
Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill