---
stable_id: skills/skills-sh-trailofbits-skills-substrate-vulnerability-scanner
type: skills
title: skills-sh-trailofbits-skills-substrate-vulnerability-scanner
summary: >-
  # Substrate Vulnerability Patterns (7 Patterns)

  This document contains detailed descriptions, detection patterns, and
  mitigations for 7 critical Substrate/FRAME vulnerabilities.

  ---

  ## 6.1 ARITHMETIC OVERFLOW ⚠️ CRITICAL

  **Description**: Primitive integer types wrap in release mode instead of
  panicking on overflow/underflow. In debug mode they panic, but production
  builds silently produce incorrect values.

  **Detection Patterns**:

  ```rust

  // VULNERABLE: Direct arithmetic on primitive types

  #[pallet::call]

  impl<T: Config> Pallet<T> {
tags:
  - skills-sh
  - skills-sh-all-time
source_url: https://raw.githubusercontent.com/trailofbits/skills/HEAD/plugins/building-secure-contracts/skills/substrate-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md
license: ""
upstream_ref: https://skills.sh/trailofbits/skills/substrate-vulnerability-scanner
github_stars: 2952
github_forks: 236
github_is_organization: true
retrieved_at: 2026-06-11T08:32:11.462Z
content_sha256: 680d9d93f9cc11731469489ca3579b844e0d0d1ffec6f73520dffdc1c3a8a9b7
---
