跳到正文
Skillpedia
安全8.0k · #12736

trailmark-variant-neighborhood

它能做什么

这项技能接收一个已确认或疑似的漏洞,并找出结构相似的代码,例如同级函数或共享的调用者。适合追踪同类问题的安全研究人员。

适用场景

  • ✓你发现了一个安全问题,想检查类似代码是否存在同样的缺陷时。
  • ✓某个漏洞取决于函数之间的调用方式,普通文本搜索会遗漏它时。
  • ✓你想把审查候选项交给变体分析或 Semgrep 规则编写步骤时。

技能链接

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

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark-variant-neighborhood/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我在这个函数中发现了一个未检查输入的漏洞。请找出其他结构相同、可能也有此问题的代码。”

每周 5 个新技能,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
常见问题

这些结果是已确认的漏洞吗?

不是。结果是供审查的候选项,而不是已确认的发现。

开始时需要已知的漏洞吗?

需要。它需要一个种子问题,可以是已确认的,也可以只是疑似的。

下一步哪些技能可以使用它的结果?

它的候选项可以作为变体分析、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

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能