Join our Newsletter — 33% off our NHI Course
Home› Guides› DAO Governance Attack Guide: Flash Loan Votes, Malicious…
Guide Fraud Prevention

DAO Governance Attack Guide: Flash Loan Votes, Malicious Proposals and Timelock Defences

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 12 min read
On this page

An on-chain governance system is an admin key held by whoever controls enough votes at the moment that counts, and attackers have shown they can rent that control for a single transaction. This guide explains how DAO governance attacks work at a level that helps defenders, and then focuses on the design choices that stop them: vote snapshots, voting delays, quorum design, timelocks, guardian roles and monitoring. It draws on the OpenZeppelin Governor and TimelockController documentation, Compound's governance documentation, ERC-5805 and Beanstalk's own post-mortem material. It is written for Web3 protocol teams, governance designers, auditors and the security leads who review proposals. It contains no exploit steps. Broader protocol risk is in the DeFi Risk Guide.

Key takeaways

  • Snapshot voting power in the past. Voting power read from a checkpoint taken before voting opens cannot be inflated by tokens borrowed and repaid in the same transaction.
  • Every fast path is an attack path. Beanstalk's emergency route let a proposal execute after one day instead of seven, and that shortcut is what the 2022 attacker used.
  • The timelock is the last review window. A delay between approval and execution gives holders, monitors and guardians time to read the code that will actually run.
  • Guardian roles must be narrow. A guardian that can cancel or pause but cannot move funds or change rules limits damage without creating a new central key.
  • Proposals need code review, not just a vote. Names and descriptions can mislead; review the calldata, the target contracts and anything they call.

How DAO governance works

Ethereum.org describes a DAO as a collectively owned organisation whose rules and treasury live in smart contracts, with decisions made through proposals and votes. It lists three membership models: token-based (voting power from a tradeable governance token), share-based (permissioned membership with shares and an exit right) and reputation-based (non-transferable reputation earned by contribution). Token-based governance is the most exposed to the attacks in this guide because voting power can be bought or borrowed.

A typical on-chain proposal lifecycle, as implemented by OpenZeppelin Governor and Compound Governor Bravo, runs as follows.

  1. Propose: an account with voting power above the proposal threshold submits a list of target contracts, values and calldata.
  2. Voting delay: a waiting period before voting power is fixed. OpenZeppelin notes that a longer delay gives users time to react; Compound describes a two-day review period.
  3. Snapshot: voting power is read at a fixed past timepoint (block number or timestamp, per the ERC-6372 clock).
  4. Voting period: holders or their delegates vote For, Against or Abstain.
  5. Queue: a successful proposal is scheduled in a timelock.
  6. Execute: after the timelock delay, anyone (or a named executor) runs the proposal's calls.

Many DAOs vote off-chain with Snapshot, which its documentation describes as off-chain, open source and gasless, then execute through a multisig. Ethereum.org notes that multisig execution is manual and adds trust in the signers. Off-chain voting removes on-chain flash loan risk from the vote itself but moves the risk to the signers and to how voting power is calculated.

ParameterWhat it controlsSecurity effect
Proposal thresholdVoting power needed to create a proposalRaises the cost of spam and hostile proposals; too high excludes small holders
Voting delayTime from proposal to snapshotGives holders time to delegate and review before power is fixed
Snapshot timepointWhen voting power is readBlocks same-transaction borrowed votes if set in the past
Voting periodHow long votes are acceptedLong enough for delegates to vote and for monitors to react
QuorumMinimum participation for a valid resultStops a small, motivated group passing proposals during low turnout
Timelock delayTime from approval to executionThe final window to cancel, exit or respond

Flash loan vote attacks

A flash loan lets anyone borrow a large amount of assets as long as the loan is repaid within the same transaction. If a governance system reads voting power from current balances, or lets newly deposited assets count immediately, an attacker can borrow enough to win a vote and repay the loan before the block ends. The mechanics of flash loans are covered in the Oracle Manipulation and Flash Loan Attacks Guide.

Case study: Beanstalk, April 2022. Beanstalk's own post says the attacker used a flash loan to exploit the governance process around 12:24 UTC on 17 April 2022 and that about 77 million US dollars was taken from the protocol's liquidity pools. The technical breakdown that Beanstalk linked identifies the design conditions that made it possible:

  • An emergency path: an emergency commit function allowed execution after one day instead of the standard seven-day voting period.
  • Immediate voting power: depositing whitelisted assets minted voting power straight away, so borrowed assets counted at once.
  • A reachable supermajority: the emergency route needed more than two thirds of voting power, and borrowed funds cleared that bar.
  • No review window for the payload: without a timelock, there was no time to inspect the code that would run.

Beanstalk then removed on-chain governance, moved to a community multisig and Snapshot voting as a temporary measure, and said on-chain governance should return only with great caution. The lesson for defenders is that each of those conditions on its own is a design choice that can be checked in review.

Related vote-buying patterns: flash loans are the extreme case. The same defences also help against borrowing governance tokens for longer periods, buying votes through markets, or accumulating delegations quietly before a low-turnout vote.

Malicious and disguised proposals

Not every governance attack needs a voting majority from borrowed funds. Many rely on voters approving something they did not understand.

  • Misleading names and descriptions: the Beanstalk breakdown records that the attacker's proposal was named to look like a routine initialisation, and that the real payload sat behind a contract created at attack time. The description is not the code.
  • Indirect execution: a proposal that calls a contract which then delegatecalls or upgrades another contract hides the real effect two steps away. Review every contract the proposal touches, including ones deployed shortly before the vote. See the Smart Contract Upgradeability and Proxy Security Guide.
  • Parameter changes that disable defences: a proposal that shortens the timelock delay, lowers quorum or adds a new timelock proposer weakens every later vote. OpenZeppelin warns that granting proposer or canceller roles to anyone other than the Governor is risky because extra proposers can bypass governance and extra cancellers can block approved proposals.
  • Low-turnout timing: proposals timed for holidays or quiet periods can pass with little scrutiny if quorum is low.
  • Last-minute swings: a large voter can wait until the end of the voting period so nobody can respond. OpenZeppelin provides GovernorPreventLateQuorum, which enforces a minimum voting period after quorum is reached, for this case.
  • Front-running proposal creation: OpenZeppelin notes proposal IDs do not include the chain ID or governor address, and offers a description suffix naming the proposer as front-running protection.

Defences: timelocks, snapshots, quorum

Attack pattern to defensive control

Attack patternPrimary defenceSupporting controls
Flash loan votingCheckpointed voting power read at a past snapshot (ERC20Votes, ERC-5805 getPastVotes)Voting delay; no voting power from same-block deposits
Emergency fast path abuseRemove fast paths, or limit them to pause and cancel onlyGuardian with narrow powers; supermajority plus delay
Disguised payloadTimelock delay long enough for independent reviewProposal simulation and code review before voting closes
Hostile parameter changeGovernance changes routed through the same timelockMinimum bounds on delay and quorum; monitoring alerts
Low-turnout captureQuorum as a share of supply at the snapshotActive delegates; notification of new proposals
Last-minute vote swingExtension after quorum (GovernorPreventLateQuorum)Longer voting period
Rogue proposer or cancellerGovernor as sole proposer and canceller on the timelockAdmin role renounced after setup; role change alerts

Vote snapshotting

OpenZeppelin's ERC20Votes keeps historical balances (checkpoints) so voting power comes from a past snapshot rather than current balances, which also prevents double voting. The Governor reads power at proposalSnapshot; with block-number clocks the snapshot is taken at the end of that block, so voting starts in the next block. Compound's getPriorVotes similarly returns votes at a finalised past block. ERC-5805 (Voting with delegation, under review as an ERC when checked in November 2026) standardises getVotes, getPastVotes and delegation, and its security notes say votes should rely on a snapshot so transfers afterwards do not change power. Check the token's clock(): ERC-5805 warns that mixing timestamp and block-number lookups can revert or return zero.

Timelocks

OpenZeppelin recommends that the TimelockController, not the Governor, holds funds, ownership and access roles, so every privileged action passes through the delay. Its roles are:

  • Proposer: queues operations. Give it only to the Governor.
  • Executor: runs operations that are ready. Setting the zero address lets anyone execute, which is safe because executors can only run what proposers scheduled.
  • Canceller: cancels queued operations. The Governor should hold it.
  • Admin: grants and revokes roles. Keep it on the timelock itself and renounce any deployer admin after setup.

Only the timelock can change its own minimum delay (updateDelay), so a delay change must itself wait out the current delay. OpenZeppelin gives no single recommended delay; choose one long enough for holders to exit and for reviewers to read a complex proposal, and set it against how fast your team can respond.

Guardian roles

Guardians give a small, accountable group a way to stop harm without the power to cause it.

  • Proposal guardian: OpenZeppelin's GovernorProposalGuardian adds an account that can cancel proposals at any lifecycle stage.
  • Pause guardian: Compound's Pause Guardian, held by a community multisig, can pause minting, borrowing, transfers and liquidation but cannot unpause and cannot block redeem or repay, so users can always exit.
  • Design rule: guardians can cancel or pause, never execute, upgrade or move funds, and the DAO can remove them by vote. Run guardian keys under multisig discipline; see the Multisig Treasury Operations Guide for Protocols and Companies and the Smart Contract Emergency Pause Guide.

Choosing a design

SituationReasonable choiceTrade-off
Small community, small treasuryOff-chain voting with multisig executionTrust in signers; fewer on-chain attack paths
Large treasury, liquid tokenOn-chain Governor with checkpoints, delay, quorum, timelock and guardianSlower changes; more parameters to secure
New launch with concentrated supplyLonger delays and guardian veto that sunsets by voteTemporary centralisation that must be disclosed
Frequent routine changesBounded parameters that governance can adjust within limitsLess flexibility for large changes

Monitoring and response

A timelock only helps if someone is watching. Monitor governance as you would production access to a payment system.

  • Proposal created: alert on every new proposal, decode its calldata, and flag calls to the timelock, upgrade functions, role grants or treasury transfers.
  • Voting power movements: alert on large delegation changes or sudden concentration in a few addresses before a snapshot.
  • Queued operations: simulate each queued call against current state and compare the result with the proposal's stated intent.
  • Role and parameter changes: alert on any change to timelock roles, delay, quorum, threshold or guardian address.

Response: if a hostile proposal passes, the guardian cancels it during the timelock window, the team communicates publicly, and users are told how to exit. Preserve transaction hashes, proposal IDs and decoded calldata as evidence. Follow the Web3 Incident Response Playbook for containment and disclosure.

Metrics: share of proposals with independent code review before voting closes; median time from proposal creation to first review alert; share of treasury and admin roles held by the timelock; number of fast paths that can bypass the delay (target zero); and voter turnout against quorum over the last ten proposals.

Common failure patterns

  • Current-balance voting: voting power read at vote time, not at a past checkpoint, which invites borrowed votes.
  • Emergency shortcuts kept after launch: fast execution paths built for early incidents that remain live, as in Beanstalk's case.
  • Funds outside the timelock: a treasury or upgrade key held by the Governor or a deployer, so the delay protects nothing.
  • Deployer admin never renounced: the setup account keeps the timelock admin role and can grant itself proposer rights.
  • Voting on the description: holders approve the title and summary without anyone decoding the calldata.
  • Guardian with too much power: a guardian that can execute or upgrade becomes the central key the DAO was meant to remove.

Framework fit: governance parameters and guardian roles sit under NIST CSF 2.0 Govern and Protect (access control over privileged functions); proposal monitoring under Detect; guardian cancellation and pause under Respond. See the Smart Contract Access Control Guide for role design.

Practitioner checklist

  • Use a checkpointed votes token and read power at a past snapshot; confirm the clock mode matches the Governor.
  • Set a voting delay and voting period long enough for delegates and reviewers to act.
  • Define quorum as a share of supply at the snapshot and review turnout regularly.
  • Put funds, ownership and admin roles behind a TimelockController with the Governor as sole proposer and canceller.
  • Renounce the deployer admin role and alert on any role change.
  • Remove emergency execution shortcuts; keep emergency powers to pause and cancel.
  • Add a narrow, removable guardian held under multisig controls.
  • Decode, simulate and review every proposal's calldata before voting closes.
  • Monitor proposals, delegations, queued operations and parameter changes in real time.
  • Rehearse the response: who cancels, who communicates, how users exit.

Standards and references

Related NHI Mgmt Group resources: DeFi Risk Guide · Oracle Manipulation and Flash Loan Attacks Guide · Web3 Incident Response Playbook · Smart Contract Access Control Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.