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, used them to acquire enough Stalk to hold a supermajority for a single transaction, and called emergencyCommit on a malicious proposal, BIP-18, whose innocuous framing was a donation to Ukraine but whose payload transferred the protocol's assets to the attacker. About 182 million dollars left the protocol, of which the attacker kept roughly 80 million after repaying the flash loans, and the rest was arbitraged or lost in the mechanics. 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.
Sources and review
- https://cointelegraph.com/news/beanstalk-farms-loses-182m-in-defi-governance-exploit
- https://www.bleepingcomputer.com/news/security/beanstalk-defi-platform-loses-182-million-in-flash-loan-attack/
- https://www.merklescience.com/blog/hack-track-analysis-of-beanstalk-flash-loan-attack
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 commonly cited near 80 million. Both figures are used with that distinction.
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.
