Security Audit
TheDecipherist/claude-code-mastery
Checks a codebase for hardcoded secrets, vulnerable dependencies, weak input handling, weak authentication and unsafe transport settings before deployment or merge.
Scans Substrate/Polkadot pallets for 7 critical vulnerabilities including arithmetic overflow, panic DoS, incorrect weights, and bad origin checks.
$ npx skills add trailofbits/skills --skill substrate-vulnerability-scanner -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install trailofbits/skills substrate-vulnerability-scanner --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner .claude/skills/substrate-vulnerability-scanner && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "substrate-vulnerability-scanner" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner into .claude/skills/substrate-vulnerability-scanner/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "substrate-vulnerability-scanner", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/trailofbits/skills/tree/main/plugins/building-secure-contracts/skills/substrate-vulnerability-scannerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add trailofbits/skills --skill substrate-vulnerability-scanner -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install trailofbits/skills substrate-vulnerability-scanner --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner .agents/skills/substrate-vulnerability-scanner && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "substrate-vulnerability-scanner" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner into .agents/skills/substrate-vulnerability-scanner/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "substrate-vulnerability-scanner", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add trailofbits/skills --skill substrate-vulnerability-scanner -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install trailofbits/skills substrate-vulnerability-scanner --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner .cursor/skills/substrate-vulnerability-scanner && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "substrate-vulnerability-scanner" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner into .cursor/skills/substrate-vulnerability-scanner/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "substrate-vulnerability-scanner", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/trailofbits/skills.git --path plugins/building-secure-contracts/skills/substrate-vulnerability-scanner--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add trailofbits/skills --skill substrate-vulnerability-scanner -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install trailofbits/skills substrate-vulnerability-scanner --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner .gemini/skills/substrate-vulnerability-scanner && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "substrate-vulnerability-scanner" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner into .gemini/skills/substrate-vulnerability-scanner/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "substrate-vulnerability-scanner", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install trailofbits/skills substrate-vulnerability-scannerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add trailofbits/skills --skill substrate-vulnerability-scanner -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner .github/skills/substrate-vulnerability-scanner && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "substrate-vulnerability-scanner" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner into .github/skills/substrate-vulnerability-scanner/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "substrate-vulnerability-scanner", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add trailofbits/skills --skill substrate-vulnerability-scanner -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install trailofbits/skills substrate-vulnerability-scanner --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner .opencode/skills/substrate-vulnerability-scanner && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "substrate-vulnerability-scanner" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner into .opencode/skills/substrate-vulnerability-scanner/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "substrate-vulnerability-scanner", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
substrate-vulnerability-scannerScans Substrate/Polkadot pallets for 7 critical vulnerabilities including arithmetic overflow, panic DoS, incorrect weights, and bad origin checks.
Substrate Vulnerability Scanner is an agent skill from trailofbits/skills, published by the product's own GitHub organization. Scans Substrate/Polkadot pallets for 7 critical vulnerabilities including arithmetic overflow, panic DoS, incorrect weights, and bad origin checks. Use when auditing Substrate runtimes or FRAME pallets.
Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including assets (for example `agents/openai.yaml` and `resources/VULNERABILITY_PATTERNS.md`).
It sits in Security, covering Vulnerability scanning. It works with Rust. The repository describes itself as: Trail of Bits Claude Code skills for security research, vulnerability detection, and audit workflows. The licence is CC-BY-SA-4.0.
11 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 82fe822. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
rgcargonodeFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
docs.substrate.ioparitytech.github.iogithub.comsubstrate.stackexchange.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Substrate Vulnerability Scanner loads about 3.2k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 1,249 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from trailofbits/skills at commit 82fe822, republished under its CC-BY-SA-4.0 licence (© trailofbits). 1,249 words, ~3,191 tokens.
.claude/skills/substrate-vulnerability-scanner/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.Systematically scan Substrate runtime modules (pallets) for platform-specific security vulnerabilities that can cause node crashes, DoS attacks, or unauthorized access. This skill encodes 7 critical vulnerability patterns unique to Substrate/FRAME-based chains.
.rs// Substrate/FRAME indicators
#[pallet]
pub mod pallet {
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
#[pallet::config]
pub trait Config: frame_system::Config { }
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(10_000)]
pub fn example_function(origin: OriginFor<T>) -> DispatchResult { }
}
}
// Common patterns
DispatchResult, DispatchError
ensure!, ensure_signed, ensure_root
StorageValue, StorageMap, StorageDoubleMap
#[pallet::storage]
#[pallet::call]
#[pallet::weight]
#[pallet::validate_unsigned]pallets/*/lib.rs - Pallet implementationsruntime/lib.rs - Runtime configurationbenchmarking.rs - Weight benchmarksCargo.toml with frame-* dependenciesWhen invoked, I will:
I check for 7 critical vulnerability patterns unique to Substrate/FRAME. For detailed detection patterns, code examples, mitigations, and testing strategies, see VULNERABILITY_PATTERNS.md.
Arithmetic Overflow ⚠️ CRITICAL
+, -, *, / operators wrap in release modechecked_* or saturating_* methodsDon't Panic ⚠️ CRITICAL - DoS
unwrap(), expect(), array indexing without bounds checkensure!Weights and Fees ⚠️ CRITICAL - DoS
Verify First, Write Last ⚠️ HIGH (Pre-v0.9.25)
#[transactional]Unsigned Transaction Validation ⚠️ HIGH
Bad Randomness ⚠️ MEDIUM
pallet_randomness_collective_flip vulnerable to collusionpallet_babe::RandomnessFromOneEpochAgo)random(subject) not random_seed()Bad Origin ⚠️ CRITICAL
ensure_signed allows any user for privileged operationsensure_root or custom origins (ForceOrigin, AdminOrigin)For complete vulnerability patterns with code examples, see VULNERABILITY_PATTERNS.md.
pallets/*/lib.rs)runtime/lib.rs)For each #[pallet::call] function:
# Search for panic-prone patterns
rg "unwrap\(\)" pallets/
rg "expect\(" pallets/
rg "\[.*\]" pallets/ # Array indexing
rg " as u\d+" pallets/ # Type casts
rg "\.unwrap_or" pallets/# Find direct arithmetic
rg " \+ |\+=| - |-=| \* |\*=| / |/=" pallets/
# Should find checked/saturating alternatives instead
rg "checked_add|checked_sub|checked_mul|checked_div" pallets/
rg "saturating_add|saturating_sub|saturating_mul" pallets/cargo test --features runtime-benchmarks# Find privileged operations
rg "ensure_signed" pallets/ | grep -E "pause|emergency|admin|force|sudo"
# Should use ensure_root or custom origins
rg "ensure_root|ForceOrigin|AdminOrigin" pallets/Report on every pattern in §5, whether or not it turned anything up. This skill has no Finding Template, so the table opens the report and the findings follow it, with all 7 rows present:
| # | Pattern | Verdict | Evidence |
|---|---|---|---|
| 1 | Arithmetic Overflow | found | src/lib.rs:212 -- + on BalanceOf<T> in do_transfer |
| 2 | Don't Panic | ||
| 3 | Weights and Fees | ||
| 4 | Verify First, Write Last | ||
| 5 | Unsigned Transaction Validation | ||
| 6 | Bad Randomness | ||
| 7 | Bad Origin |
Each verdict is one of:
found — cite file:line and write the finding up in full after the table.clear — the pattern applies to this pallet and the pallet handles it. Name the macro, origin check, or
arithmetic method you searched for, so a reader can repeat the search.n/a — the pattern cannot apply here. Give the reason in one clause ("this pallet accepts no unsigned
transactions"). Not having looked is not n/a. Note that pattern 4 is version-scoped (pre-v0.9.25): say
which runtime version the pallet targets rather than dropping the row.A table with fewer than 7 rows is an incomplete scan and must be reported as one. A row whose Verdict cell is empty is incomplete in the same way: row 1 above is filled in to show the shape, and every row is filled in the same way before the report is done. Seven clear verdicts is a
result a reader can act on. A report that covers three patterns and says nothing about the other four reads
exactly like a clean pallet, and that is the failure this table exists to prevent.
// Use test-fuzz for property-based testing
#[cfg(test)]
mod tests {
use test_fuzz::test_fuzz;
#[test_fuzz]
fn fuzz_transfer(from: AccountId, to: AccountId, amount: u128) {
// Should never panic
let _ = Pallet::transfer(from, to, amount);
}
#[test_fuzz]
fn fuzz_no_panics(call: Call) {
// No dispatchable should panic
let _ = call.dispatch(origin);
}
}# Run benchmarks to generate weights
cargo build --release --features runtime-benchmarks
./target/release/node benchmark pallet \
--chain dev \
--pallet pallet_example \
--extrinsic "*" \
--steps 50 \
--repeat 20# Test runtime upgrades
cargo build --release --features try-runtime
try-runtime --runtime ./target/release/wbuild/runtime.wasm \
on-runtime-upgrade live --uri wss://rpc.polkadot.iobuilding-secure-contracts/not-so-smart-contracts/substrate/Before completing Substrate pallet audit:
Arithmetic Safety (CRITICAL):
+, -, *, / operators in dispatchableschecked_* or saturating_*try_into() with error handlingPanic Prevention (CRITICAL):
unwrap() or expect() in dispatchablesensure!Weights & DoS (CRITICAL):
Access Control (CRITICAL):
ensure_root or custom originsensure_signed only for user-level operationsStorage Safety (HIGH):
#[transactional]Other (MEDIUM):
random(subject) not random_seed()Testing:
found, clear or n/a with a reasonn/a costs one
clause and makes the judgment reviewable. Silence records nothing, and a reader cannot tell it apart from
not having checked.+ on a
Balance is pattern 1 whether or not the compiler said anything, and debug assertions do not run on a
production node.ensure_signed is an origin check." It establishes that someone signed, not that the right someone
did. Pattern 7 is about which origin is required, and ensure_signed where ensure_root belongs passes
this rationalization while failing the check.© trailofbits, CC-BY-SA-4.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (assets) in plugins/building-secure-contracts/skills/substrate-vulnerability-scanner of trailofbits/skills.
Open the folder on GitHubat commit 82fe822
Substrate Vulnerability Scanner next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Substrate Vulnerability Scanner this skilltrailofbits/skills | 7.4k | — | ~3.2k | Automated safety check: Pass | CC-BY-SA-4.0 | |
| Security AuditTheDecipherist/claude-code-mastery | 550 | — | ~1.3k | Automated safety check: Notes | MIT | |
| Pyspector Security AuditParzivalHack/PySpector | 151 | — | ~3.5k | Automated safety check: Notes | Apache-2.0 | |
| Security Reviewgithub/awesome-copilot | 40k | 1 repos | ~2.3k | Automated safety check: Notes | MIT | |
| Sca AuditOWASP/secure-agent-playbook | 186 | — | ~494 | Automated safety check: Pass | CC-BY-4.0 | |
| Time Aware Dependency Cve ScannerArabelaTso/Skills-4-SE | 253 | — | ~2.1k | Automated safety check: Pass | Apache-2.0 |
TheDecipherist/claude-code-mastery
Checks a codebase for hardcoded secrets, vulnerable dependencies, weak input handling, weak authentication and unsafe transport settings before deployment or merge.
ParzivalHack/PySpector
Run a full Python codebase security audit using PySpector (https://github.com/ParzivalHack/PySpector), a Rust-core SAST scanner.
github/awesome-copilot
AI-powered codebase security scanner that reasons about code like a security researcher — tracing data flows, understanding component interactions, and catching vulnerabilities that pattern-matching…
OWASP/secure-agent-playbook
Scan project dependencies for known vulnerabilities (CVEs). An agent skill from OWASP/secure-agent-playbook.
ArabelaTso/Skills-4-SE
Scan repositories for newly disclosed CVEs in dependencies after a specific cutoff date.
jwynia/agent-skills
Detect CVEs and security issues in project dependencies. An agent skill from jwynia/agent-skills.
trailofbits/skills
Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.
trailofbits/skills
Generates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows.
trailofbits/skills
Compares Trailmark code graphs at two snapshots, such as commits, tags or directories, to surface attack paths, blast radius and taint changes that text diffs miss.
trailofbits/skills
Draws a 12 Houses tarot spread to break ties when a request is vague or casually delegated, then reads the cards to pick the next step.
trailofbits/skills
Detects languages, proposes rulesets for approval, then runs the approved Semgrep scan across a codebase and merges the output into one SARIF file.
trailofbits/skills
Searches and extracts data from Burp Suite project files on the command line: regex searches over responses, audit findings, proxy history and site map data.
Works with
Categories
Scans Substrate/Polkadot pallets for 7 critical vulnerabilities including arithmetic overflow, panic DoS, incorrect weights, and bad origin checks. Substrate Vulnerability Scanner is an agent skill from trailofbits/skills, published by the product's own GitHub organization. Scans Substrate/Polkadot pallets for 7 critical vulnerabilities including arithmetic overflow, panic DoS, incorrect weights, and bad origin checks.
Substrate Vulnerability Scanner fits situations like: auditing Substrate runtimes; tasks that involve Vulnerability scanning.
Run `npx skills add trailofbits/skills --skill substrate-vulnerability-scanner -a claude-code`. Or copy the skill folder (plugins/building-secure-contracts/skills/substrate-vulnerability-scanner in trailofbits/skills) into .claude/skills/substrate-vulnerability-scanner in your project. Claude Code loads it when a task matches its description.
Run `npx skills add trailofbits/skills --skill substrate-vulnerability-scanner -a codex`. Or copy the skill folder (plugins/building-secure-contracts/skills/substrate-vulnerability-scanner in trailofbits/skills) into .agents/skills/substrate-vulnerability-scanner in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add trailofbits/skills --skill substrate-vulnerability-scanner -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/substrate-vulnerability-scanner, .gemini/skills/substrate-vulnerability-scanner, .github/skills/substrate-vulnerability-scanner and .opencode/skills/substrate-vulnerability-scanner in your project.
Going by SKILL.md and its folder, Substrate Vulnerability Scanner needs the command-line tools its instructions call (rg, cargo and node).
SKILL.md names 4 domains. As links in the text: docs.substrate.io, paritytech.github.io, github.com and substrate.stackexchange.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Substrate Vulnerability Scanner is published under the CC-BY-SA-4.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Substrate Vulnerability Scanner: Security Audit (TheDecipherist/claude-code-mastery, 550 stars), Pyspector Security Audit (ParzivalHack/PySpector, 151 stars), Security Review (github/awesome-copilot, 40k stars) and Sca Audit (OWASP/secure-agent-playbook, 186 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
trailofbits (a GitHub organization, an official publisher) maintains it in trailofbits/skills, which has 7,400 GitHub stars. The repository holds 79 skills in this directory. The repository was last updated on October 2, 2026.
Source: trailofbits/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.