substrate-vulnerability-scanner

Scans Substrate FRAME pallets for seven critical vulnerability patterns including overflow, panics, and bad origins.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/Ayoub-ouederni/SENTINEL --skill substrate-vulnerability-scanner-ayoub-ouederni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: substrate-vulnerability-scanner
Source: https://github.com/Ayoub-ouederni/SENTINEL/tree/main/.claude/skills/substrate-vulnerability-scanner
Command: npx skills add https://github.com/Ayoub-ouederni/SENTINEL --skill substrate-vulnerability-scanner-ayoub-ouederni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Auditing Substrate and Polkadot pallets for platform-specific security flaws is manual and error-prone, and missed issues like arithmetic overflow or panic-based DoS can crash nodes or enable unauthorized access in production runtimes. ## Core Features & Use Cases - Seven Vulnerability Patterns: Detects arithmetic overflow, panic DoS, incorrect weights, verify-first violations, unsigned transaction flaws, bad randomness, and bad origin checks. - Structured Scanning Workflow: Guides platform detection, dispatchable analysis, panic sweeps with ripgrep, weight review, and origin privilege audits. - Severity Prioritization & Fixes: Classifies findings as Critical, High, or Medium and provides mitigation code using checked arithmetic, ensure_root, and BABE randomness. - Use Case: Before launching a Polkadot parachain, run the scanner across all pallets in pallets/*/lib.rs to catch unwrap() calls, fixed weights on variable-cost extrinsics, and ensure_signed misuse on privileged functions. ## Quick Start Audit the Substrate pallets in this repository for the seven critical vulnerability patterns and report findings with severity and fixes.

Frequently Asked Questions about substrate-vulnerability-scanner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Substrate pallets for security vulnerabilities?

Scan each pallet's dispatchable functions for the seven critical patterns: unchecked arithmetic, unwrap/expect panics, fixed weights on variable-cost operations, storage writes before validation, weak unsigned transaction validation, insecure randomness, and ensure_signed on privileged calls. Use ripgrep searches and benchmarking to confirm findings.

What are the most critical Substrate FRAME vulnerabilities?

The critical ones are arithmetic overflow from direct operators wrapping in release mode, panics from unwrap or unchecked indexing that halt block production, incorrect weights enabling DoS spam, and bad origin checks letting any signed user execute privileged operations.

Does Substrate v0.9.25 fix storage write rollback issues?

Yes, Substrate v0.9.25 introduced a transactional storage layer that automatically rolls back writes when a dispatch fails. On earlier versions, you must validate before writing or apply the manual #[transactional] attribute to prevent partial state changes.

Why is RandomnessCollectiveFlip insecure for production pallets?

RandomnessCollectiveFlip is vulnerable to validator collusion and manipulation, making it unsuitable for production. Use BABE randomness via pallet_babe::RandomnessFromOneEpochAgo and call random(subject) rather than random_seed() for per-call uniqueness.

When should I use ensure_root instead of ensure_signed?

Use ensure_root or custom origins like ForceOrigin for privileged operations such as emergency pauses, fee updates, or force transfers. Reserve ensure_signed for regular user-level operations, and remove sudo privileges before production launch.