| name | access-control |
| description | Missing modifiers, wrong msg.sender checks, default-public functions, missing onlyOwner / onlyRole / onlyDAO authorization. |
| metadata | {"subdomain":"smart-contracts","when_to_use":"smart contract access control onlyowner missing modifier privilege","mitre_attack":["T1190"]} |
Access Control Playbook
Access control bugs are the most boring class — and the most common in
production audits. They're cheap to find with grep + LSP. They drain
millions when missed (LeetSwap, Audius, Saddle, Akropolis).
Audit steps
1. Find every state-changing function
grep -rE 'function [a-zA-Z_]+\(.*\)(public|external)' src/ | grep -v 'view\|pure'
slither . --print function-summary
2. For each external/public state-changer, ask
- Does it modify storage that affects user funds, ownership, or
configuration?
- Is there a modifier (
onlyOwner, onlyRole, onlyDAO, custom auth)?
- If yes, what's the modifier checking?
- If no, should there be one?
3. Audit each modifier
Common modifier patterns + bugs:
| Pattern | Bug |
|---|
require(msg.sender == owner) | owner settable by anyone? unprotected? |