CommunityRecherche & Datenanalysegithub.com

trailofbits/trailmark

Erstellt und durchsucht mehrsprachige Quellcode-Graphen für Sicherheitsanalysen. Enthält Voranalyse-Pässe für Explosionsradius, Taint-Propagation, Privilegiengrenzen und Einstiegspunkt-Enumeration.

Was ist trailmark?

Trailmark ist ein leistungsstarkes Werkzeug zur Erstellung und Abfrage mehrsprachiger Quellcode-Graphen, speziell entwickelt für Sicherheitsanalysen. Es ermöglicht die Analyse von Aufrufpfaden, die Kartierung der Angriffsfläche, das Auffinden von Komplexitäts-Hotspots, die Enumeration von Einstiegspunkten, die Verfolgung von Taint-Propagation und die Messung des Explosionsradius. Das Tool unterstützt mehrere gängige Programmiersprachen (Python, JavaScript, TypeScript, Java, Go, Rust, C, C++, C#, Ruby, PHP, Swift, Kotlin, Solidity, Vyper) und bietet einen flexiblen CLI-Modus sowie eine Python API. Trailmark führt eine Reihe von Voranalyse-Pässen durch, darunter die Identifizierung von Privilegiengrenzen (z. B. admin_required), Taint-Quellen und -Senken, Berechnungen des Explosionsradius und Aufrufpfad-Analysen. Die Ergebnisse werden als interaktiver Graph im DOT-Format ausgegeben oder als strukturiertes JSON für die weitere Verarbeitung. Dieses Skill ist besonders nützlich für Sicherheitsforscher, die komplexe Codebasen auditieren und priorisieren müssen.

Funktioniert mit~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/trailofbits/skills/tree/main/skills/trailmark

Installed? Explore more Recherche & Datenanalyse skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht trailmark?

Erstellt und durchsucht mehrsprachige Quellcode-Graphen für Sicherheitsanalysen. Enthält Voranalyse-Pässe für Explosionsradius, Taint-Propagation, Privilegiengrenzen und Einstiegspunkt-Enumeration. Verwenden Sie dies beim Analysieren von Aufrufpfaden, Kartieren der Angriffsfläche, Finden von Komplexitäts-Hotspots, Enumerieren von Einstiegspunkten, Verfolgen von Taint-Propagation, Messen des Explosionsradius oder Erstellen eines Code-Graphen zur Audit-Priorisierung. Bevorzugen Sie trailmark.parse.detect_languages() oder --language auto, wenn die Zielsprache unbekannt oder polyglott ist.

Funktionen

  • Mehrsprachige Unterstützung: Python, JavaScript, TypeScript, Java, Go, Rust, C, C++, C#, Ruby, PHP, Swift, Kotlin, Solidity, Vyper
  • Voranalyse-Pässe:
    • Privilegiengrenzen (z. B. admin_required)
    • Taint-Quellen und -Senken
    • Explosionsradius-Berechnung
    • Aufrufpfad-Analyse
  • Graph-Erstellung: Generiert interaktive Code-Graphen im DOT-Format
  • Abfrage-Engine: Durchsuchen Sie den erstellten Graphen nach bestimmten Mustern oder Beziehungen

Plattformen

  • CLI: Bietet einen flexiblen Kommandozeilen-Modus für Batch-Verarbeitung und Skripterstellung
  • Python API: Ermöglicht die Integration in benutzerdefinierte Analyse-Pipelines

So funktioniert es

Trailmark analysiert Quellcode-Dateien und erstellt einen abstrakten Syntaxbaum (AST) für jede unterstützte Sprache. Es identifiziert dann wichtige Code-Strukturen wie Funktionen, Klassen, Importe und Aufrufbeziehungen. Basierend auf dieser Analyse werden die folgenden Voranalyse-Pässe durchgeführt:

  1. Privilegiengrenzen: Findet Stellen im Code, die Zugriffskontrollen implementieren (z. B. Decoratoren wie @admin_required in Python)
  2. Taint-Propagation: Identifiziert Eingabequellen (z. B. HTTP-Anfragen) und Senken (z. B. SQL-Datenbanken) für Datenflüsse
  3. Explosionsradius: Berechnet, wie viele Code-Pfade von einer gegebenen Änderung betroffen wären
  4. Einstiegspunkt-Enumeration: Listet alle öffentlich zugänglichen Funktionen oder API-Endpunkte auf

Die Ergebnisse werden als gerichteter Graph im DOT-Format ausgegeben, der die Beziehungen zwischen den Code-Elementen visualisiert. Optional können die Ergebnisse auch als JSON oder CSV exportiert werden.

Verwendung

CLI

trailmark parse --language python --input /path/to/code --output graph.dot
trailmark query --input graph.dot --type taint_sources

Python API

import trailmark

# Erstelle einen Parser für Python-Code
parser = trailmark.Parser(language="python")

# Parse ein Verzeichnis
graph = parser.parse("/path/to/code")

# Führe Voranalyse-Pässe durch
privilege_boundaries = graph.find_privilege_boundaries()
taint_sources = graph.find_taint_sources()
entry_points = graph.enumerate_entry_points()

# Exportiere den Graphen
graph.export("graph.dot")

Konfiguration

  • --language auto: Automatische Erkennung der Sprache (für polyglotte Projekte)
  • --output-format dot|json|csv: Ausgabeformat
  • --analyze-blst-radius: Explosionsradius-Analyse aktivieren
  • --taint-passthrough: Taint-Propagation-Pass aktivieren
  • --privilege-patterns: Benutzerdefinierte Privilegiengrenzen-Muster

Beispielausgabe

digraph G {
  node [shape=box, style=filled, fillcolor=lightblue];
  
  "main" -> "parse_input";
  "parse_input" -> "validate";
  "main" -> "handle_request";
  "handle_request" -> "authenticate" [label="@admin_required"];
}

Fehlerbehebung

  • Sprachfehlererkennung: Wenn die automatische Erkennung fehlschlägt, geben Sie die Sprache explizit mit --language an
  • Große Projekte: Verwenden Sie --limit-files N, um die Anzahl der zu analysierenden Dateien zu begrenzen
  • Graph-Größe: Aktivieren Sie --simplify, um redundante Knoten zu entfernen

Siehe auch

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

trailofbits/address-sanitizer

AddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.

trailofbits/aflpp

AFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C/C++ projects.

trailofbits/agentic-actions-auditor

Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations.

trailofbits/algorand-vulnerability-scanner

Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL/PyTeal).

trailofbits/ask-questions-if-underspecified

Clarify requirements before implementing. Use when serious doubts arise.

trailofbits/atheris

Atheris is a coverage-guided Python fuzzer based on libFuzzer. Use for fuzzing pure Python code and Python C extensions.

trailofbits/audit-augmentation

Augments Trailmark code graphs with external audit findings from SARIF static analysis results and weAudit annotation files. Maps findings to graph nodes by file and line overlap, creates severity-based subgraphs, and enables cross-referencing findings with pre-analysis data (blast radius, taint, etc.). Use when projecting SARIF results onto a code graph, overlaying weAudit annotations, cross-referencing Semgrep or CodeQL findings with call graph data, or visualizing audit findings in the context of code structure.

trailofbits/audit-context-building

Enables ultra-granular, line-by-line code analysis to build deep architectural context before vulnerability or bug finding.

trailofbits/audit-prep-assistant

Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments).

trailofbits/burpsuite-project-parser

Searches and explores Burp Suite project files (.burp) from the command line. Use when searching response headers or bodies with regex patterns, extracting security audit findings, dumping proxy history or site map data, or analyzing HTTP traffic captured in a Burp project.

trailofbits/cairo-vulnerability-scanner

Scans Cairo/StarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.

trailofbits/cargo-fuzz

cargo-fuzz is the de facto fuzzing tool for Rust projects using Cargo. Use for fuzzing Rust code with libFuzzer backend.

trailofbits/chrome-mcp-troubleshooting

Diagnose and fix Claude in Chrome MCP extension connectivity issues. Use when mcp__claude-in-chrome__* tools fail, return "Browser extension is not connected", or behave erratically.

trailofbits/claude-in-chrome-troubleshooting

Diagnose and fix Claude in Chrome MCP extension connectivity issues. Use when mcp__claude-in-chrome__* tools fail, return "Browser extension is not connected", or behave erratically.

trailofbits/code-improver

Runs an autonomous review-and-fix improvement loop over any code target — a skill, plugin, module, or directory — using a reviewer the user names: any installed skill or agent. Keeps a cross-round findings ledger, escalates when fixes stop converging, and guards scope mechanically. Use when asked to 'improve this code until review passes', 'run an improvement loop with <reviewer>', or to iterate review-and-fix with a specific reviewer. For skills prefer the skill-improver entry; for a branch prefer pr-improver.

trailofbits/code-maturity-assessor

Systematic code maturity assessment using Trail of Bits' 9-category framework. Analyzes codebase for arithmetic safety, auditing practices, access controls, complexity, decentralization, documentation, MEV risks, low-level code, and testing. Produces professional scorecard with evidence-based ratings and actionable recommendations.

trailofbits/codeql

Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking analysis. Triggers on "run codeql", "codeql scan", "codeql analysis", "build codeql database", or "find vulnerabilities with codeql". Supports "run all" (security-and-quality + security-experimental suites) and "important only" (high-precision security findings) scan modes. Also handles creating data extension models and processing CodeQL SARIF output.

trailofbits/constant-time-analysis

Detects timing side-channel vulnerabilities in cryptographic code. Use when implementing or reviewing crypto code, encountering division on secrets, secret-dependent branches, or constant-time programming questions in C, C++, Go, Rust, Swift, Java, Kotlin, C#, PHP, JavaScript, TypeScript, Python, or Ruby.

trailofbits/constant-time-testing

Constant-time testing detects timing side channels in cryptographic code. Use when auditing crypto implementations for timing vulnerabilities.

trailofbits/cosmos-vulnerability-scanner

Scans Cosmos SDK blockchain modules and CosmWasm contracts for consensus-critical vulnerabilities — chain halts, fund loss, state divergence. 25 core + 16 IBC + 10 EVM + 3 CosmWasm patterns. Use when auditing custom x/ modules, reviewing IBC integrations, or assessing pre-launch chain security. Updated for SDK v0.53.x.

Verwandte Skills