packages/skills/skills/security-building-secure-contracts/SKILL.md
| Vulnerability | Description | Mitigation |
|---|---|---|
| Reentrancy | External calls allow recursive entry | Checks-Effects-Interactions pattern; ReentrancyGuard |
| Integer overflow/underflow | Arithmetic wraps silently (pre-0.8) | Use Solidity >=0.8 or SafeMath |
| Access control | Missing or incorrect permission checks | OpenZeppelin Ownable/AccessControl; multi-sig for admin |
| Flash loan manipulation | Price or governance manipulation via atomic loans | Time-weighted oracles; commit-reveal schemes |
| Front-running | Mempool observation enables MEV extraction | Commit-reveal; private mempools; batch auctions |
| Delegatecall injection | Arbitrary code execution via delegatecall | Restrict delegatecall targets; avoid user-controlled addresses |
| Storage collision | Proxy upgrade storage layout conflicts | Use EIP-1967 storage slots; OpenZeppelin upgradeable contracts |
| Vulnerability | Description | Mitigation |
|---|---|---|
| Missing signer check | Instructions accept unsigned accounts | Verify account.is_signer |
| Missing owner check | Accounts owned by wrong program | Verify account.owner == program_id |
| Account confusion | Wrong account type passed | Use discriminators; Anchor account validation |
| Arithmetic overflow | Unchecked math in native Rust | Use checked_add, checked_mul; saturating math |