Chapter 6
Smart Contract Vulnerabilities
Smart contracts run in a hostile environment. Any public function can be called by anyone, in any order, and often from another contract with unexpected side effects. Security bugs are usually logic errors, not broken cryptography.
The OWASP-style catalog for Solidity groups recurring failure modes. Knowing these patterns helps users evaluate protocol risk and helps builders design defensively from the first line of code.
Reentrancy made history with early DAO exploits, but access control failures remain common in admin functions left unprotected after a refactor. Always ask who can pause, upgrade, or withdraw protocol reserves.
Composability multiplies risk. Your contract may be sound in isolation yet unsafe when called through a flash loan, a manipulated oracle, or a malicious token with a custom transfer hook.