0x-shashi/web3-audit-skills/variant-analysis
Claude Code and agent skill by 0x-shashi/web3-audit-skills
- community
Checking that the SKILL.md file is still in the repository.
Systematically hunt for every variant of a discovered vulnerability across the entire codebase. Use when a bug is found and all instances of the same root cause pattern must be identified, or when performing variant analysis during competitive audits on Code4rena or Sherlock.
Install
npx vskill@latest install 0x-shashi/web3-audit-skills/variant-analysisSKILL.md
The same SKILL.md was published earlier as 0x-shashi/web3-audit-skills/variant-analysis.
Variant Analysis Skill
Purpose
When you find one vulnerability, systematically hunt for every variant of the same root cause across the entire codebase. Variant analysis is the difference between finding 1 bug and finding 5–15 bugs from a single discovery. Elite auditors use this skill to multiply their finding count and provide comprehensive coverage.
Why Variant Analysis Matters
| Situation | Without Variant Analysis | With Variant Analysis | |
|---|---|---|---|
Found unchecked return in withdraw() | Report 1 finding | Search all external calls → find 4 more instances → 5 findings | |
Found missing access control on setFee() | Report 1 finding | Check all admin functions → find setPause(), setOracle() unprotected → 3 findings | |
Found reentrancy in claim() | Report 1 finding | Check all state-changing functions with external calls → find liquidate() also vulnerable → 2 findings | |
Found rounding error in deposit() | Report 1 finding | Check all division operations → find withdraw(), getExchangeRate() → 3 findings |
Real-world data: Analysis of Code4rena and Sherlock contest results shows that top auditors consistently find 2–5x more instances of a bug class than median auditors, primarily through systematic variant analysis.
Core Concept
The Abstraction Ladder
Moving from a specific bug to a general pattern:
Optimal search level: Level 2–3. Too specific (Level 0–1) misses variants. Too broad (Level 4) produces too many false positives.
Variant Dimensions
A single root cause can manifest across multiple dimensions:
1. Same Function, Different Contracts
2. Same Root Cause, Different Functions
3. Same Pattern, Different Manifestation
4. Cross-Contract Variants
5. Cross-Protocol Variants
Root Cause Taxonomy
| Root Cause Category | Common Variants | Search Strategy | |
|---|---|---|---|
| Missing validation | Unchecked return, missing bounds, no zero-check | Grep all external interactions | |
| Incorrect ordering | CEI violation, pre-state read, TOCTOU | Trace state reads vs external calls | |
| Access control gap | Missing modifier, wrong role, unprotected init | Grep all public/external functions | |
| Arithmetic error | Wrong rounding, precision loss, overflow | Grep all division/multiplication | |
| State inconsistency | Stale cache, cross-function read, reentrancy | Map state dependencies | |
| Integration mismatch | Fee-on-transfer, non-standard ERC20, decimals | List all token interactions | |
| Oracle dependency | Stale price, spot manipulation, decimal mismatch | Find all price reads | |
| Timing dependency | Block timestamp, deadline, frontrunning | Grep all time-based logic |
Process Overview
- Find: Discover initial vulnerability during audit
- Abstract: Reduce to root cause pattern at Level 2–3
- Search: Grep/regex/AST search entire codebase for the pattern
- Validate: Confirm each match is actually reachable and exploitable
- Expand: Check related patterns (same root cause, different manifestation)
- Report: Group all variants under single root cause with per-instance severity
Variant Sources
| Source | Use Case | Example | |
|---|---|---|---|
| Current audit findings | Found 1, find all | Reentrancy in one function → check all | |
| Cyfrin/Solodit database | Historical pattern matching | "This oracle pattern has 145+ findings" | |
| DeFiHackLabs | Real exploit reproduction | "Euler hack used same reentrancy variant" | |
| Code4rena / Sherlock reports | Cross-protocol patterns | "Compound fork X had this — check Y" | |
| Known Solidity compiler bugs | Version-specific issues | "Solidity <0.8.15 has ABI encoder bug" | |
| OpenZeppelin advisories | Dependency vulnerabilities | "OZ v4.7.3 has governance vulnerability" |
Resources
- Variant Patterns — Catalog of 12 major variant pattern classes with search strategies
- Variant Hunt Workflow — Step-by-step methodology for executing a variant hunt
Integration with Other Skills
| Skill | Integration | |
|---|---|---|
cyfrin-findings/ | Query historical findings for the same root cause pattern | |
patterns/ | Cross-reference with vulnerability pattern catalog | |
anti-patterns/ | Anti-pattern signatures can seed variant searches | |
exploit-forensics/ | Real-world exploits reveal pattern classes to hunt for | |
static-analysis/ | Automate variant detection with custom Slither detectors | |
checklists/ | Each variant class maps to checklist items |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/variant-analysis/SKILL.md
Popularity
- Repository stars
- 62
- Repository forks
- 10
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/0x-shashi/web3-audit-skills/variant-analysis)