substrate-vulnerability-scanner
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.
npx skills add trailofbits/skills --skill substrate-vulnerability-scanner --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Substrate Vulnerability Scanner ## 1. Purpose 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. ## 2. When to Use This Skill - Auditing custom Substrate pallets - Reviewing FRAME runtime code - Pre-launch security assessment of Substrate chains (Polkadot parachains, standalone chains) - Validating dispatchable extrinsic functions - Reviewing weight calculation functions - Assessing unsigned transaction validation logic ## 3. Platform Detection ### File Extensions & Indicators - **Rust files**: `.rs` ### Language/Framework Markers ```rust // 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, StorageM
- 1. Purpose
- 2. When to Use This Skill
- 3. Platform Detection
- File Extensions & Indicators
- Language/Framework Markers
- Project Structure
- Tool Support
- 4. How This Skill Works
- 5. Vulnerability Patterns (7 Critical Patterns)
- Pattern Summary:
- 6. Scanning Workflow
- Step 1: Platform Identification
- Step 2: Dispatchable Analysis
- Step 3: Panic Sweep
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/What does the substrate-vulnerability-scanner skill do?
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.
How do I install it?
Run `npx skills add trailofbits/skills --skill substrate-vulnerability-scanner --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From trailofbits/skills, a repository with 6,426 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
