variant-analysis

Identify similar vulnerability variants across a codebase using pattern-based and taint-aware analysis.

1|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/adamatdevops/forge-works --skill variant-analysis-adamatdevops
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: variant-analysis
Source: https://github.com/adamatdevops/forge-works/tree/main/.skills/trailofbits/variant-analysis
Command: npx skills add https://github.com/adamatdevops/forge-works --skill variant-analysis-adamatdevops

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

It helps you locate recurring copies and adaptations of a known vulnerability pattern across an entire repository, so patched issues don’t reappear in other code paths.

Core Features & Use Cases

  • Root-cause-first methodology: starts from a clear statement of why the bug is exploitable, then builds search patterns from that root cause.
  • Incremental pattern generalization: supports a stepwise ladder (exact match to progressively abstract matches) with an explicit stop rule when false positives rise too far.
  • Static-analysis workflow templates: uses ready-to-run CodeQL and Semgrep taint-style rules (plus supporting pattern rules) to surface likely variants, then guides triage and reporting.

Quick Start

Use the variant-analysis skill after you have identified a specific vulnerable pattern, and ask it to search the whole repository for similar data-to-sink flows and produce a variant report you can review.

Frequently Asked Questions about variant-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find variants of a known vulnerability across my codebase?

Variant analysis identifies similar vulnerability instances across a codebase by applying incremental pattern-based and taint-aware static analysis to locate recurring copies and adaptations of a known root-cause bug.

How do I write CodeQL and Semgrep rules to hunt for copy-paste security bugs?

You build rules by deriving exact matches from a root-cause description, then iteratively generalizing the taint-style patterns while measuring the false-positive rate until it rises too far.

Do I need a root-cause description to perform variant analysis?

Yes, a clear statement of why the bug is exploitable is required as a starting point to derive exact matches and progressively generalize search patterns across the repository.

What is the best way to validate that a patched security issue does not reappear in other code paths?

Use post-patch variant hunting to systematically search the entire repository for similar data-to-sink flows, triage the locations, and document exploitability to ensure the fix is comprehensive.

How does taint analysis handle false positives when generalizing vulnerability patterns?

The process uses a stepwise ladder from exact to progressively abstract matches with an explicit stop rule, halting generalization when the false-positive rate becomes too high.