Skip to content
Back to skills

Variant Analysis

ASecurity

Given a confirmed finding, search the whole target/ for semantically similar bugs. Applies the trailofbits variant-analysis approach — one root cause usually breeds siblings.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 18, 2026
researchpythonshellapi

Works with

  • api

Security analysis

A100/100

Scanned November 18, 2026

npx -y skills add rasata/coldvault.dev --skill variant-analysis --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Variant Analysis?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Variant Analysis
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rasata-variant-analysis/badge)](https://www.skillsdirectory.com/skills/rasata-variant-analysis)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: variant-analysis
description: Given a confirmed finding, search the whole target/ for semantically similar bugs. Applies the trailofbits variant-analysis approach — one root cause usually breeds siblings.
license: MIT (ZONOVA RESEARCH — coldvault.dev)
source_inspiration: trailofbits/skills/variant-analysis
---

# variant-analysis

## Why

Most real audits discover a bug once and miss its five siblings. Variant
analysis closes that gap systematically.

## Procedure

For each HIGH/MEDIUM finding:

1. **Extract the smallest characterising pattern.** Not the specific code, the
   *shape*. Example — finding: `child_process.exec(req.body.cmd)`. Shape:
   "user-controlled input flows into an exec-family call without escaping."
2. **Codify the shape as a Semgrep rule** (see `semgrep-rule-creator`).
3. **Run repo-wide.** Log the new hits in `reports/variants/<finding-id>.sarif`.
4. **For each hit, determine:**
   - Same root cause (e.g. shared helper) → collapse into a single finding
     with a list of call-sites.
   - Independent occurrence → create a new finding with reduced confidence
     (cap 0.85) unless you verified the taint path.
5. **Broaden the search.** If the language uses a different idiom for the same
   operation (Python `subprocess.run(..., shell=True)` vs. `os.system` vs.
   `commands.getoutput`), add each to the rule and re-run.

## Example — expanding a single finding

Initial finding:
```python
# target/app/handlers.py:42
subprocess.call(request.form['cmd'], shell=True)  # CMD-INJECTION
```

Shape:
- source: `request.form[*]`, `request.args[*]`, `request.json[*]`
- sink: `subprocess.(call|run|Popen|check_output)` with `shell=True` OR
        `os.system(*)` OR `os.popen(*)` OR `commands.getoutput(*)`

Run the taint rule. Possible variants found:
- `handlers.py:88` — same pattern via `os.system`
- `admin/utils.py:14` — helper `run_cmd(s)` called from 7 sites with user-supplied `s`
- `worker.py:120` — same pattern but sanitised by `shlex.quote` — **not a bug**

## Output

Append to `reports/findings.json`:
- a `variants` array inside the parent finding listing all call sites, OR
- separate findings with `metadata.parent_id` pointing to the original.

Ensure `reports/SUMMARY.md` links every HIGH finding to its variant list.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in research →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.