kz-tob 9e3fd2f9e8 constant-time-analysis: pair ilspycmd's TFM with a matching runtime (#283)
* constant-time-analysis: pair ilspycmd's TFM with a matching runtime

The tool-store fallback in _get_il_output globbed for
`*/ilspycmd/*/tools/net8.0/any/ilspycmd.dll`. ilspycmd 9.x installs
under `tools/net9.0/`, so on any newer install the glob matched
nothing, the loop body never ran, and C# IL analysis fell through to
monodis and then to "IL disassembly tools not available" — while
`dotnet tool install -g ilspycmd`, the command that error recommends,
produces exactly the layout the glob could not see.

Widening the glob to net* alone would have been wrong. The next lines
run the assembly under a Homebrew dotnet@8 runtime, and that pairing is
deliberate: ilspycmd installs framework-dependent and .NET does not
roll forward across a major version by default, so a net9.0 assembly
will not start on an 8.0 runtime. A wide glob with a pinned runtime
turns a silent no-match into a silent failed exec.

So the TFM found on disk now selects the runtime. Candidates are tried
newest-first, sorting the parsed (major, minor) tuple rather than the
moniker string, since lexically "net10.0" sorts below "net8.0"; a TFM
whose runtime is absent falls back to an older one that has one. Store
entries that do not name a .NET runtime major (netstandard2.0, net48)
are skipped rather than producing a dotnet@netstandard2 path. The
arbitrary `break` after the first matching dll is gone.

Extracted to _il_via_versioned_runtime so _get_il_output stays flat.

TestCSharpILRuntimePairing covers it with a fake store and fake runtime
paths, needing no dotnet install. The suite was mutation-tested rather
than trusted green: against the old pinned glob two tests fail, and
against the naive widening four fail, including the one asserting a
net9.0 assembly is never handed to dotnet@8.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* constant-time-analysis: don't depend on one Homebrew keg existing

Review P2 on #283: pairing the store TFM with /opt/homebrew/opt/dotnet@N
assumes a keg for that major exists, and if it does not the motivating
failure just moves from the glob to the exists() check.

`brew info dotnet@9` says the keg does exist — stable 9.0.120 — so the
ilspycmd 9.x case the PR was written for does work as shipped. The
general concern holds anyway: homebrew-core carries dotnet@6, dotnet@8
and dotnet@9 but dropped dotnet@7 at end of life, and no Linux
distribution ships a versioned keg at all.

So the exact-major keg is now preferred rather than required. After it
come the unversioned Homebrew prefixes, the official installer paths for
macOS and Linux, and the PATH dotnet, each tried with
DOTNET_ROLL_FORWARD=Major, which is what permits a net9.0 assembly to
start on a 10.x runtime. Roll-forward is set only on those candidates:
setting it on the exact-major keg would mask a genuinely mismatched pair
instead of letting it fail, which is the property the existing test
pins. The PATH entry resolves through shutil.which, since dotnet_path
defaults to the bare name "dotnet" and exists() on a bare name tests the
cwd.

The except clause widens from FileNotFoundError to OSError. This is P3,
included because the change makes it reachable: adding the Intel prefixes
means an Intel keg on an Apple Silicon box without Rosetta is now a live
candidate, and it raises OSError("Bad CPU type in executable") rather
than FileNotFoundError, which escaped the helper and aborted the whole
analysis.

Review P2 on references/vm-compiled.md: the only user-facing remedy still
said `brew install dotnet@8` and claimed the analyzer detects dotnet@8.
It now tells the reader to read the TFM out of the tool store, names the
keg gap, and explains that the roll-forward path means no install is
strictly required. The store lookup uses find rather than ls on a glob,
for the reason #282 documents.

Five tests added, each mutation-checked: dropping the generic tier,
setting roll-forward unconditionally, narrowing OSError back, and
deleting the DOTNET_ROOT line each fail exactly the test that covers
them. DOTNET_ROOT had no assertion before, so that line could be deleted
with the suite green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 11:05:27 -04:00

Trail of Bits Skills Marketplace

A Claude Code plugin marketplace from Trail of Bits providing skills to enhance AI-assisted security analysis, testing, and development workflows. Codex can load this marketplace through its Claude marketplace compatibility.

Also see: claude-code-config · codex-config · skills-curated · claude-code-devcontainer · dropkit · coop

Installation

Claude Code Marketplace

/plugin marketplace add trailofbits/skills

Browse and Install Plugins

/plugin menu

Codex

Codex supports Claude plugin marketplaces directly, so this repository does not need Codex-specific sidecar metadata.

Install the marketplace with:

codex plugin marketplace add trailofbits/skills
codex plugin list
codex plugin add <plugin-name>@trailofbits

Local Development

To add the marketplace locally (e.g., for testing or development), navigate to the parent directory of this repository:

cd /path/to/parent  # e.g., if repo is at ~/projects/skills, be in ~/projects
/plugins marketplace add ./skills

Available Plugins

Smart Contract Security

Plugin Description
building-secure-contracts Smart contract security toolkit with vulnerability scanners for 6 blockchains and 5 development guideline assistants
entry-point-analyzer Identify state-changing entry points in smart contracts for security auditing

Code Auditing

Plugin Description
agentic-actions-auditor Audit GitHub Actions workflows for AI agent security vulnerabilities
audit-context-building Understand a codebase before looking for bugs in it, one function at a time
burpsuite-project-parser Search and extract data from Burp Suite project files
c-review Comprehensive C/C++ security code review, with coverage verified against a parse of the source
differential-review Security-focused differential review of code changes with git history analysis
dimensional-analysis Annotate codebases with dimensional analysis comments to detect unit mismatches and formula bugs
fp-check Systematic false positive verification for security bug analysis with mandatory gate reviews
insecure-defaults Parallel audit workflow for fail-open insecure defaults, with a refuting verifier per candidate file
rust-review Comprehensive Rust security review covering safe/unsafe boundary, memory safety, concurrency, panic-DoS, FFI, and async runtime with SARIF output
semgrep-rule-creator Create and refine Semgrep rules for custom vulnerability detection
semgrep-rule-variant-creator Port existing Semgrep rules to new target languages with test-driven validation
sharp-edges Identify error-prone APIs, dangerous configurations, and footgun designs
static-analysis Static analysis toolkit with CodeQL, Semgrep, and SARIF parsing
supply-chain-risk-auditor Audit npm, PyPI, and Go dependencies for version-matched advisories, abandoned upstreams, publisher concentration, and install scripts
testing-handbook-skills Skills from the Testing Handbook: fuzzers, static analysis, sanitizers, coverage
trailmark Code graph analysis, bounded subagent context slicing, Mermaid diagrams, mutation testing triage, and protocol verification
variant-analysis Find similar vulnerabilities across codebases using pattern-based analysis
vulnerability-triage-brocards Triage vulnerability reports using 7 brocards to accept, dismiss, or request more info before deeper analysis

Malware Analysis

Plugin Description
yara-authoring YARA detection rule authoring with linting, atom analysis, and best practices

Verification

Plugin Description
constant-time-analysis Detect compiler-induced timing side-channels in cryptographic code
mutation-testing Configure mewt/muton mutation testing campaigns — scope targets, tune timeouts, optimize long runs
property-based-testing Write, review, and triage property-based tests — Hypothesis, fast-check, proptest, and Echidna or Medusa for Solidity invariants
spec-to-code-compliance Check code against the documentation that specifies it, across contracts, C/C++, services, and firmware
writing-lean-proofs Write structured Lean 4 proofs and design Lean libraries following Mathlib conventions
zeroize-audit Detect missing or compiler-eliminated zeroization of secrets in C/C++ and Rust

Reverse Engineering

Plugin Description
dwarf-expert Analyze DWARF debug info: parse and search DIEs, verify integrity, write DWARF parsing code

Mobile Security

Plugin Description
firebase-apk-scanner Scan Android APKs for Firebase security misconfigurations

Development

Plugin Description
code-improver Autonomous review-and-fix workflow over skills, plugins, or a branch, with a pluggable reviewer, findings ledger, escalation, and scope guard
devcontainer-setup Create pre-configured devcontainers with Claude Code and language-specific tooling
gh-cli Intercept GitHub URL fetches — WebFetch, MCP fetch tools, and curl/wget — and redirect to the authenticated gh CLI
git-cleanup Safely clean up git worktrees and local branches: a dynamic workflow gathers merge evidence and tries to refute its own delete recommendations, behind gated confirmation
goal-prompt Draft /goal commands for goal mode in Claude Code and Codex — verifiable completion conditions formatted to a copy-ready single line
github-triage Triage open GitHub issues and PRs: merge ready bot/approved PRs, review unreviewed ones via subagents, close resolved issues with cited comments, cross-link pending fixes, and score the rest with local-only priority and change-size estimates
let-fate-decide Draw Tarot cards using cryptographic randomness to add entropy to vague planning
modern-cpp Modern C++ best practices (C++20/23/26) with compiler hardening and safe idioms
modern-python Modern Python tooling and best practices with uv, ruff, and pytest
open-sourcing Prepare a repository for public release: secrets hygiene, licensing, CI readiness, and release automation
second-opinion Run code reviews using external LLM CLIs (OpenAI Codex, Google Gemini) on changes, diffs, or commits. Bundles Codex's built-in MCP server.

Team Management

Plugin Description
culture-index Interpret Culture Index survey results for individuals and teams

Tooling

Plugin Description
claude-in-chrome-troubleshooting Diagnose and fix Claude in Chrome MCP extension connectivity issues

Trophy Case

Bugs discovered using Trail of Bits Skills. Found something? Let us know!

When reporting bugs you've found, feel free to mention:

Found using Trail of Bits Skills

Skill Bug
constant-time-analysis Timing side-channel in ML-DSA signing

Contributing

We welcome contributions! See AGENTS.md for skill authoring guidelines, and run make check before you push — it runs most of CI locally (see AGENTS.md for what it does not cover).

License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Made by Trail of Bits.

S
Description
semgrep: Runs a Semgrep security scan over a codebase: detects languages, selects rulesets, presents the plan for explicit approval, then runs every approved ruleset…; modern-python: Configures Python projects with modern tooling (uv, ruff, ty). Use when creating projects, writing standalone scripts, or migrating from pip/Poetry/mypy/black.; codeql: Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking analysis. Triggers on "run codeql", "code…
Readme CC-BY-SA-4.0 14 MiB
Languages
Python 64.6%
JavaScript 18.8%
Shell 12.6%
YARA 0.6%
C 0.5%
Other 2.6%