Agent skill · Design & Presentation

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.

trailofbitsgithub.com/trailofbitsGitHub ↗
claude-codeCC-BY-SA-4.0
Install
npx skills add trailofbits/skills --skill substrate-vulnerability-scanner --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 4
SKILL.md size: 9 KB
Bundled scripts: none
Path: plugins/building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 6,426
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. 1. Purpose
  2. 2. When to Use This Skill
  3. 3. Platform Detection
  4. File Extensions & Indicators
  5. Language/Framework Markers
  6. Project Structure
  7. Tool Support
  8. 4. How This Skill Works
  9. 5. Vulnerability Patterns (7 Critical Patterns)
  10. Pattern Summary:
  11. 6. Scanning Workflow
  12. Step 1: Platform Identification
  13. Step 2: Dispatchable Analysis
  14. Step 3: Panic Sweep
Ships with 3 files
  • agents/openai.yaml
  • assets/trail-of-bits-mark.svg
  • resources/VULNERABILITY_PATTERNS.md
Commands it runs
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/
More from skills
All skills →
About this skill
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.

Keep going