Zum Inhalt springen
Skillpedia
Sicherheit8.0k · #12736

trailmark-variant-neighborhood

Was er macht

Dieser Skill nimmt eine bestätigte oder vermutete Schwachstelle und findet Code mit ähnlicher Struktur, etwa Geschwisterfunktionen oder gemeinsame Aufrufer. Er richtet sich an Sicherheitsforscher, die weitere Vorkommen desselben Problems suchen.

Wann du ihn nutzt

  • ✓Wenn du ein Sicherheitsproblem gefunden hast und prüfen willst, ob ähnlicher Code denselben Fehler hat.
  • ✓Wenn ein Fehler davon abhängt, wie Funktionen einander aufrufen, und eine einfache Textsuche ihn übersehen würde.
  • ✓Wenn du Review-Kandidaten an eine Varianten-Analyse oder das Schreiben einer Semgrep-Regel weitergeben willst.

Link zum Skill

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

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark-variant-neighborhood/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Ich habe in dieser Funktion einen Fehler mit ungeprüfter Eingabe gefunden. Finde anderen Code mit derselben Struktur, der ihn vielleicht auch hat.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Skill verknüpft das Problem mit einem Punkt im Codegraphen und erweitert dann auf verwandte Funktionen, gemeinsame Aufrufer und Senken, Schnittstellen-Implementierungen und ähnlichen Code. Die Ergebnisse werden als Kandidaten für die Prüfung eingestuft.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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
Häufige Fragen

Sind die Ergebnisse bestätigte Fehler?

Nein. Die Ergebnisse sind Kandidaten für eine Prüfung, keine bestätigten Befunde.

Braucht er einen bekannten Fehler als Start?

Ja. Er braucht ein Ausgangsproblem, das bestätigt oder nur vermutet sein kann.

Welche Skills können seine Ergebnisse danach nutzen?

Seine Kandidaten können die Varianten-Analyse, das Erstellen von Semgrep-Regeln, die statische Analyse oder manuelle Prüfungen starten.

Details

Originalbeschreibung des Autors

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

Beliebtheit

GitHub-Sterne
8.0k
Platz im Ranking
#12736
Lizenz
CC-BY-SA-4.0
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills