Langsung ke konten
Skillpedia
Keamanan8.0k ยท #12739

variant-analysis

Fungsinya

Skill ini mengambil bug yang sudah Anda temukan dan mencari contoh lain dari akar penyebab yang sama di seluruh basis kode. Skill ini untuk auditor keamanan dan developer yang baru menemukan suatu isu.

Kapan dipakai

  • โœ“Saat sebuah bug ditemukan di satu berkas dan Anda ingin tahu di mana lagi bug itu muncul.
  • โœ“Saat Anda ditanya apakah masalah baru itu sama dengan bug sebelumnya.
  • โœ“Saat Anda ingin mengubah satu bug yang diketahui menjadi aturan pencarian CodeQL atau Semgrep.

Link skill

https://github.com/trailofbits/skills/blob/main/plugins/variant-analysis/skills/variant-analysis/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/trailofbits/skills/blob/main/plugins/variant-analysis/skills/variant-analysis/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œKami baru menemukan pemeriksaan izin yang hilang di berkas ini. Apakah ada tempat lain di kode yang melakukan kesalahan yang sama?โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill ini bekerja dalam lima langkah: menemukan akar penyebab, menulis pola yang hanya cocok dengan bug yang diketahui, menggeneralisasi pola itu, lalu mencari kecocokan di kode.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Variant Analysis

Find the other instances of a bug you have already found. One root cause usually has several manifestations, and they are rarely in the module where you found the first one.

When to Use

  • A vulnerability has been found and you need to search for similar instances
  • Building or refining CodeQL/Semgrep queries for security patterns
  • Performing systematic code audits after an initial issue discovery
  • Analyzing how a single root cause manifests in different code paths

When NOT to Use

  • Initial vulnerability discovery โ€” use audit-context-building or a domain-specific audit
  • General code review with no known pattern to search for
  • Writing fix recommendations โ€” use issue-writer
  • Understanding unfamiliar code โ€” use audit-context-building first

The Five Steps

Read the reference for a step when you reach it.

1. Understand the original issue. Extract the root cause โ€” why the code is wrong, not what it does โ€” and enumerate the directions a variant could hide in: related identifiers, other manifestations of the same mistake, data-type edge cases. โ†’ references/root-cause.md

2. Create an exact match. Write a pattern matching ONLY the known instance and confirm it hits. A pattern that matches nothing means you have misunderstood the bug, and every search built on it is calibrated against the wrong code.

3โ€“4. Generalize one element at a time. Climb from the exact match toward the pattern family, running and reading all matches after each single change. Stop when more than half the matches are noise. โ†’ references/searching.md โ€” abstraction ladder, tool selection, false-positive filters

5. Triage. Decide which candidates are real, and say so with a severity attached. โ†’ references/triage.md

Then write it up, including the patterns that failed and a CI rule to prevent regression. โ†’ references/reporting.md

Running it as a Workflow

This plugin ships /variant-analysis:variants, which runs the five steps across parallel subagents โ€” one per expansion axis, looping until the sweep stops finding anything new. Each stage reads the reference above that matches its job.

Use the workflow when the codebase is large or the root cause has many manifestations. Work the steps directly when the search is narrow or you want a say in each generalization.

What Makes Hunts Fail

  1. Narrow scope โ€” searching only the module the original bug was in
  2. Pattern too specific โ€” searching one attribute and missing the family around it
  3. One vulnerability class โ€” chasing a single manifestation of the root cause
  4. Happy-path testing โ€” never trying the null, empty, and boundary cases
  5. Generalizing too fast โ€” abstracting several elements at once, so noise cannot be attributed to any one of them

The first three are covered in root-cause.md and searching.md, the fourth in triage.md.

Resources

CodeQL (resources/codeql/): python.ql, javascript.ql, java.ql, go.ql, cpp.ql

Semgrep (resources/semgrep/): python.yaml, javascript.yaml, java.yaml, go.yaml, cpp.yaml

Report: resources/variant-report-template.md

Pertanyaan umum

Apakah ini untuk menemukan bug baru dari nol?

Tidak. Skill ini untuk menemukan lebih banyak contoh dari bug yang sudah Anda ketahui.

Apakah skill ini menulis perbaikannya?

Tidak. Skill ini fokus pada pencarian varian dan tidak menulis saran perbaikan.

Apakah skill ini bisa membantu menulis aturan pencarian?

Ya. Skill ini bisa membantu membuat kueri CodeQL atau Semgrep dari satu contoh yang diketahui.

Detail

Deskripsi asli dari pembuat

Hunts for the other instances of a bug already found โ€” the variants of one root cause across a codebase. Use immediately after a vulnerability, logic bug, or bad pattern turns up in a specific file and the question becomes where else it occurs, including the bare conversational form ("are there others like this?", "is this the same bug?"). Also for generalizing one known instance into a CodeQL or Semgrep query for its whole pattern family, and for triaging a set of look-alike candidates against a known root cause. Not for initial discovery with no bug in hand.

repo: trailofbits/skills

Popularitas

Bintang GitHub
8.0k
Peringkat
#12739
Lisensi
CC-BY-SA-4.0
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa