DAO governance attack vectors and defenses
A DAO treasury that exceeds the market cost of acquiring a passing quorum is an open bounty. Governance security requires defense-in-depth across snapshot timing, timelocks, monitoring, and scoped veto powers.
Primary governance threat matrix
Governance attacks exploit either economic asymmetry (acquiring temporary voting power cheaper than the extractable treasury value) or human attention limits (sneaking harmful actions past fatigued voters).
| Attack Vector | Mechanism | Primary Engineering Defense |
|---|---|---|
| Flash-loan vote capture | Borrow governance tokens, propose or vote, and repay inside one atomic transaction. | Mandatory historical checkpointing (ERC20Votes.getPastVotes) with votingDelay ≥ 1 block (practically 1–2 days). |
| Multi-block lending / spot rent | Borrow tokens on a lending market or buy spot + short hedge across the snapshot block, pass a treasury drain, and exit. | Quorum above borrowable float, multi-day voting delay, timelock + emergency cancel guardian, and treasury value caps. |
| Malicious calldata / UI spoofing | Publish benign prose (“Routine Parameter Tune”) while hiding a treasury transfer or proxy upgrade in encoded calldata. | Mandatory independent calldata decoding, automated fork simulation, and human-readable diff alerts before vote start. |
| Stealth / holiday timing | Submit a proposal during major holidays or alongside a flood of spam proposals hoping defenders miss quorum checks. | Predictable monthly voting cycles, automated Discord/Telegram/calendar alerts, and minimum 5–7 day voting windows. |
| Vote buying & bribery markets | Pay token holders directly for specific ballots via smart-contract bribe markets or off-chain agreements. | Lock-weighted or time-aligned voting, delegate reputation accountability, and shielded voting where appropriate. |
| Proposal threshold griefing | Spam proposals or repeatedly consume a DAO’s queue capacity to exhaust delegate attention. | Meaningful proposal submission threshold (or refundable proposal bond) and forum gatekeeping before on-chain sponsorship. |
Flash-loan and borrowed-token voting defenses
Modern OpenZeppelin Governor + ERC20Votes contracts completely eliminate single-transaction flash-loan voting because voting power is read strictly from a historical checkpoint block (proposalSnapshot) recorded after a non-zero votingDelay. Snapshot.org provides the same single-block immunity by pinning a past block when the proposal is created.
However, multi-block borrowing remains a live risk whenever a token is heavily supplied on permissionless money markets. If an attacker can borrow tokens one block before the snapshot block, hold them for a single block across the snapshot, and return them immediately after, they retain full voting power for the entire voting period at negligible borrow interest. Mitigations include:
- Keep quorum strictly above extractable risk: Never let a DAO’s immediately transferable treasury exceed the cost of acquiring a passing majority unless guarded by a timelock + veto mechanism.
- Use multi-day voting delays: A 24–72 hour
votingDelaygives monitoring bots and legitimate token holders time to notice sudden borrow spikes and move tokens or delegate before the snapshot block is struck. - Restrict proposal creation threshold: Require meaningful delegated stake to instantiate an on-chain proposal so attackers cannot cheaply probe snapshot timing.
Malicious calldata and social-engineering proposals
In on-chain governance, the Markdown text shown on a frontend has zero cryptographic binding to the executable calldata array. An attacker can copy a popular community grant writeup word-for-word while swapping one address inside targets[] or adding an extra approve() call.
Iron rule for delegates
Never vote For an executable on-chain proposal or optimistic Safe payload without reading the decoded function signatures, target contract addresses, and state-diff simulation. If a proposal contains unverified contracts on block explorers, vote Against by default.
Timelocks, cancel guardians, and scope limits
A TimelockController inserts a mandatory delay (commonly 48 hours to 7 days) between a proposal passing and its execution. That delay achieves two critical protections:
- User exit window: Protocol users who disagree with an upgrade or suspect governance capture can withdraw deposits before new code takes effect.
- Scoped Guardian veto: Many DAOs empower an elected Security Council multisig with a cancel-only role on the Timelock. Critically, a cancel guardian can stop a malicious queued transaction but cannot propose or execute arbitrary treasury withdrawals on its own, preserving credible neutrality while eliminating catastrophic single-vote drains.
Pre-deployment governance security checklist
- [ ]Confirm non-zero
votingDelayandvotingPeriod: Verify both values in blocks/seconds match target chain block times (watch closely for L2 sequencer block-time differences!). - [ ]Check Timelock role assignments: Verify
PROPOSER_ROLEbelongs solely to the Governor,EXECUTOR_ROLEis open (address(0)) or clearly scoped, and deployerDEFAULT_ADMIN_ROLEhas been renounced. - [ ]Deploy independent alerting: Subscribe security stewards to automated on-chain listeners (e.g., OpenZeppelin Defender / Forta / custom webhook monitors) on
ProposalCreated,ProposalQueued, and Safe nonce events. - [ ]Test emergency pause & cancel drills: Confirm Security Council signers know how to verify and execute a Timelock cancellation on testnet before an actual incident occurs.