本文へスキップ
Skillpedia
セキュリティ8.0k · #12736

trailmark-variant-neighborhood

できること

確認済みまたは疑わしいセキュリティの脆弱性を1つ取り、似た構造のコード、例えば兄弟関数や共有の呼び出し元を見つけます。同じ問題の別の例を探すセキュリティ研究者向けです。

使う場面

  • ✓1つのセキュリティ問題を見つけ、似たコードに同じ欠陥がないか確認したいとき。
  • ✓バグが関数同士の呼び出し方に依存していて、単純なテキスト検索では見逃すとき。
  • ✓レビューの候補を、変種分析やSemgrepのルール作成の段階へ渡したいとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark-variant-neighborhood/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“この関数に、入力の確認漏れのバグを見つけました。同じように構成された、他にもそれを持つかもしれないコードを見つけてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、問題をコードグラフ上の1点に結び付け、関連する関数、共有の呼び出し元や終点、インターフェースの実装、似たコードに広げます。結果はレビューの候補として順位付けされます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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

Rationalization Why It Is Wrong Required Action
"Nearby code means variant" Proximity is only a candidate reason Rank it as a review target
"Only exact same names matter" Variants often share sinks or preconditions, not names Expand across callers, callees, interfaces, and types
"Every candidate is a finding" This skill outputs candidates for review Avoid vulnerability claims
"Unreachable candidates can be ignored completely" They may become reachable after refactors Rank lower or list as deferred
"Graph candidates replace semantic pattern work" Graph structure finds locations, not root-cause semantics Hand 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
よくある質問

結果は確認済みのバグですか?

いいえ。結果は確認された発見ではなく、レビューのための候補です。

始めるのに既知のバグが必要ですか?

はい。1つの出発点となる問題が必要で、それは確認済みでも、疑われているだけでも構いません。

その結果は次にどのスキルで使えますか?

候補は、変種分析、Semgrepのルール作成、静的解析、手動レビューの段階の出発点になります。

詳細

作者による元の説明

Expands one confirmed or suspected vulnerability into a Trailmark graph neighborhood of variant candidates by finding sibling functions, shared callers and callees, common sensitive sinks, common entrypoint paths, interface implementations, override relationships, type/reference neighbors, and structurally similar nodes. Use after one issue is found to seed variant-analysis, semgrep-rule-creator, static-analysis, or manual review with graph-derived candidate locations.

repo: trailofbits/skills

人気

GitHubのスター
8.0k
ランキング
#12736
ライセンス
CC-BY-SA-4.0
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル