Curriculum·G202 Vulnerability Classes a User Must Understand·about 30 min

Economic and governance attacks

By the end of this lesson you can

  • →Distinguish an economic attack, where the code works and the incentives are exploited, from a code bug
  • →State how Beanstalk let a flash loan buy a supermajority of governance and execute a malicious proposal in one transaction
  • →Compute why a governance system with instant execution and borrowable voting power has no real threshold
  • →Identify, for a protocol you use, whether its governance can be rented and whether a proposal can execute instantly

Graduate · enrolled learners

This lesson opens with Beanstalk Farms, 17 April 2022.

What happened
Beanstalk was a governance-controlled stablecoin protocol whose voting power came from holding its Stalk tokens. Its governance module had an emergencyCommit function that executed a proposal immediately once it had supermajority support. The attacker took about 1 billion dollars in flash loans from Aave, used them to acquire enough Stalk to hold more than 67 percent of the voting power for a single transaction, and called emergencyCommit on a malicious proposal, BIP-18. It was submitted alongside BIP-19, and the pair were presented as a donation to Ukraine, but BIP-18's payload transferred the protocol's assets to the attacker. About 182 million dollars of collateral left the protocol, of which roughly 80 million went to the attacker as profit after the flash loans were repaid, per Merkle Science. No line of code malfunctioned; the governance system did exactly what a supermajority told it to do.
The decision point
Beanstalk's invariant was that changes to the protocol require the consent of its stakeholders, expressed as a supermajority vote. That invariant assumed voting power was held, not borrowed, and that a proposal could not execute the instant it passed. Both assumptions were false: Stalk could be acquired with a flash loan for one transaction, and emergencyCommit executed immediately. So a supermajority was rentable by the minute, and the vote and the execution happened atomically, giving no one time to react. This is the economic and governance class: the code is correct and the incentives are the exploit. A user assessing a governed protocol asks whether its voting power can be rented and whether a passing proposal can execute before anyone can respond.
Recorded loss
$182,000,000

What you will be able to answer

  • →What is an economic or governance attack?
  • →How was Beanstalk drained?
  • →Why is instant execution plus borrowable votes fatal?
  • →The two defenses against rentable governance?

Orientation and Year One are open: anyone can read them without an account. From Year Two onward the lessons are for enrolled learners, because progress through the later years only means anything if it is tracked against a record.

It is free. We do not sell the list and there is nothing to buy at the end of it.

Terms used here

Sources and review

Confidence high·Volatility medium·Reviewed 2026-09-14·Owner unassigned

Contested

About 182 million dollars left the protocol; the attacker's net after repaying roughly 1 billion in flash loans is about 80 million per Merkle Science and Cointelegraph. Both figures are used with that distinction. Of the proceeds, 250,000 dollars went to a Ukraine donation address through the companion proposal BIP-19.

J308-02 owns governance as an attack surface from the participant's angle. This lesson uses Beanstalk for the economic-and-governance vulnerability class. Keep the split.