trailmark-variant-neighborhood
하는 일
확인되었거나 의심되는 취약점 하나를 가져와, 구조가 비슷한 코드(형제 함수나 공유 호출자처럼)를 찾습니다. 같은 문제의 다른 사례를 찾는 보안 연구자를 위한 것입니다.
사용하는 경우
- ✓보안 문제 하나를 찾았고 비슷한 코드에 같은 결함이 있는지 확인하고 싶을 때.
- ✓버그가 함수들이 서로를 호출하는 방식에 달려 있어서, 단순 텍스트 검색으로는 놓칠 때.
- ✓변형 분석이나 Semgrep 규칙 작성 단계로 검토 후보를 넘기고 싶은 경우.
스킬 링크
https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark-variant-neighborhood/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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-creatordirectly. - 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-analysissemgrep-rule-creatorstatic-analysiswith 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.
댓글
- …
이 저장소의 다른 스킬
audit-context-building
8.0k에이전트가 보안 검토 전에 낯선 코드베이스를 익히고, 각 함수가 가정하고 보장하며 의존하는 것을 정리하도록 돕습니다.
algorand-vulnerability-scanner
8.0k에이전트가 TEAL이나 PyTeal 기반 Algorand 스마트 계약에서 키 재설정 공격, 수수료 미검증 등 보안 문제 11가지를 찾도록 돕습니다.
audit-prep-assistant
8.0k에이전트가 외부 보안 검토를 위해 코드베이스를 준비하도록 돕습니다. 정적 분석, 테스트 커버리지, 죽은 코드 정리, 명확한 문서화를 포함합니다.
cairo-vulnerability-scanner
8.0k에이전트가 StarkNet Cairo 스마트 계약에서 오버플로, 위험한 계층 간 메시지, 서명 재사용 등 6가지 문제를 검사하도록 돕습니다.