The 17 April 2022 attack on Beanstalk Farms was over in thirteen seconds and netted $182 million. An attacker studying the DeFi lending protocol’s governance mechanism noticed that its credit-line system — which let holders of STALK governance tokens propose and execute changes via BIP votes — could be hijacked with flash-loan capital: borrow a voting majority out of thin air, pass a malicious emergency proposal that drained the protocol’s vaults to the attacker’s address, repay the flash loan, and walk away, all within the atomic block-flashloan window that Ethereum’s composability enables. The attacker used an Aave flash loan (~$1.08 billion momentarily, among the largest ever maneuvered at that date) to acquire enough STALK to satisfy the 2/3 majority quorum, executed the drain via an emergency-execution function that carried no timelock, and sent the stolen stablecoin-and-ETH mix to Tornado Cash. The elegant horror of Beanstalk was that no key was stolen and no code was exploited in the vulnerability sense: the governance system functioned exactly as designed, and the design allowed a majority-for-rent to redirect the treasury. Beanstalk’s team acknowledged the exploit within hours, the protocol’s value collapsed essentially to zero, and the attacker — never conclusively identified, though chain analysts traced preparation wallets and a stated Ukraine-donation promise that was never verifiably kept — became the reference case for the governance-attack class that every subsequent DeFi protocol design review now screens for: timelocks, quorum sanity, and flash-loan-resistant voting.
On 2022-04-17, an attacker drained Beanstalk Farms (Ethereum credit-based stablecoin protocol) of ~$182M via a flash-loan governance attack. Chain: attacker took an Aave flash loan (~$1.08B temporary: ETH, USDC, USDT, DAI bundles), swapped for BEAN+STALK/Seed tokens to acquire voting weight exceeding the 2/3 majority needed to pass a BIP (Beanstalk Improvement Proposal), and executed two malicious proposals that were self-submitted days earlier via fresh identities: the emergency function they invoked (an EIP that directed vault funds to attacker addresses) had no timelock. Result: ~$182M in non-BEAN vault assets (USDC/USDT/DAI/ETH etc.) transferred out; flash loan repaid within the same transaction; net proceed ~$182M gross, routed to Tornado Cash. Protocol fallout: BEAN depegged; Beanstalk value wiped; team posted postmortem within 24h acknowledging the governance-design failure (no timelock + flash-loan-acquirable voting power). Lesson armour: governance actions need (1) timelocks (e.g. 48h+) so flash-votes can’t execute instantly, (2) quorum/voting-power ceilings and loan-resistant snapshots (e.g. snapshot at earlier block, vesting, balance-at-distance), (3) emergency-execution paths with multisig oversight — the attack class is now standard in DeFi audit checklists.
What happened
Beanstalk was a credit-based stablecoin protocol: BEAN tokens were minted/burned to track a dollar peg, governed by STALK holders through BIP proposals. Its governance had two properties that turned fatal in combination: proposal execution required a 2/3 supermajority of STALK voting weight, and emergency proposals — intended for crisis response — could execute immediately rather than after the standard waiting period. Additionally, nothing prevented voting weight acquired in the same block from counting.
On 17 April, the attacker prepared two proposals (submitted days before under separate identity, a patient-looking setup step), then in a single transaction block: drew the enormous flash loan on Aave, swapped the borrowed stablecoins into BEAN and deposited for STALK to instantly hold far more than 2/3 of voting power, voted both malicious proposals through, and the winning proposal executed an emergency function that transferred all contract-held non-BEAN collateral (~$182M) to attacker-controlled addresses. The loan was repaid in the same transaction (Ethereum’s atomicity: if repayment fails, everything reverts), so the attacker risked only gas. From flash-loan draw to treasury drain: ~13 seconds of block time.
Afterwards, funds moved through Tornado Cash. An on-chain message attributed to the attacker promised donation of proceeds to Ukraine; blockchain-forensics consensus is that no meaningful verified donation followed. Beanstalk’s team confirmed the mechanics within hours and published a postmortem acknowledging the core failure — governance design that allowed same-block borrowed voting power with no execution delay.
The attack mechanics
Beanstalk flash-loan governance attack:
SETUP (days before)
attacker self-submits two BIP
proposals via fresh on-chain
identities
proposals innocent-looking but
contain emergency-fund-direction
logic
EXPLOIT BLOCK (single tx)
1. flash-borrow ~$1.08B on Aave
(ETH/USDC/USDT/DAI)
2. swap to BEAN; deposit BEAN
-> receive STALK (voting weight)
now > 2/3 supermajority
3. self-vote both proposals PASS
4. winning proposal invokes
emergency execute (NO TIMELOCK)
-> contract vault's non-BEAN
collateral (~$182M) swept to
attacker addresses
5. repay flash loan + fee in same
transaction
(atomicity: any step fails ->
entire tx reverts; attacker risk
= gas)
EXIT
proceeds -> Tornado Cash mixer
unverified Ukraine-donation
message posted
DESIGN FAILURES
same-block voting power counted
no timelock on emergency exec
quorum vs float: loan-scale
capital could satisfy 2/3
attacker needed no exploit of
code bug - governance worked
exactly as designed
Impact and numbers
| Metric | Value |
|---|---|
| Date | 2022-04-17 |
| Stolen | ~$182M (USDC/USDT/DAI/ETH and other non-BEAN vault assets) |
| Flash loan size | ~$1.08B momentarily drawn (Aave) |
| Exploit duration | ~13 seconds (single-block sequence) |
| Governance threshold abused | 2/3 supermajority of STALK voting weight |
| Missing control | Timelock on emergency execution; flash-loan-resistant voting snapshot |
| Protocol effect | BEAN depeg; Beanstalk TVL effectively wiped |
| Attacker outcome | Unidentified; proceeds via Tornado Cash; promised Ukraine donation unverifiable |
Timeline
| Date | Event |
|---|---|
| 2022-02/03 | Beanstalk runs post-mortem governance reviews after earlier flash-loan scrutiny of DeFi; no design change to timelock/emergency path |
| 2022-04-13ish | Attacker submits the two malicious proposals via fresh identities (execution-ready payloads) |
| 2022-04-17 | Flash-loan governance attack executes: treasury drained in one block; BEAN depegs; team postmortem within 24h |
| 2022-04→05 | Funds tumbled via Tornado Cash; forensics traces partial paths; no attribution |
| 2022 later | Beanstalk relaunch planning (Barn Raise / reorg attempts) proceeds — protocol rebuilds with revised governance |
| 2022→2026 | “Governance attack” becomes standard audit category; timelock+sandboxed-voting designs become the norm across DeFi |
Why it still matters in 2026
Because Beanstalk is the cleanest laboratory demonstration that in DeFi, governance is code — and code that can be rented for one block can be weaponised for one block. The attack required zero cryptographic failure, zero exploit of a buffer overflow or reentrancy: it composed legitimate protocols (Aave’s flash loans, Beanstalk’s own governance) into an illegitimate outcome, which is why “economic-design security” became a first-class audit discipline alongside code review. Every serious protocol post-2022 ships with timelocks on privileged actions (the industry-standard 48h class), voting-power snapshot rules that measure balances at earlier blocks or vesting horizons so a flash majority is arithmetically impossible, and explicit threat-model rows for flash-loan-manipulable oracles and quorums. The regulatory conversation absorbed it too: post-2022 enforcement and the EU’s MiCA frame governance-exploitable protocols as design defects, not victimless mechanical quirks, forcing founders to treat economic-attack surface with the same seriousness as smart-contract bugs. And the number — $1.08 billion borrowed for seconds to steal $182 million — remains the standing illustration of flash-loan leverage economics: an attacker with zero capital can rent the balance sheet of a mid-sized bank for one transaction, so any DeFi mechanism whose security assumption is “nobody would spend that much to attack us” is not a security assumption at all.
Detection and hardening takeaways
- Timelock every privileged action. Emergency-execution paths without delay are exactly what flash-governance attacks consume; a 24–72h timelock converts “instant drain via borrowed majority” into “visible pending transaction the community and guardians can dispute/frontrun-protect.”
- Make voting power flash-loan-proof. Snapshot voting weight at a past block (or require vesting/duration) so same-block capital cannot constitute a quorum; cap single-voter weight; require quorum denominators that borrowed float cannot satisfy within one transaction’s slippage budget.
- Audit economics, not just Solidity. Beanstalk’s code executed correctly; the mechanism design failed. Post-2022 audit checklists mandate explicit economic-attack scenarios (flash-loan vote, oracle manipulation, self-dealing proposals) with the same rigour as reentrancy checks.
- Watch governance in real time. Detection teams monitoring proposal submission, voter composition, and execution queues can catch malicious BIPs in their pending window — the two attack proposals sat on-chain for days before execution, visible to anyone profiling “new identity + privileged-fund-direction payload.”
- Design recovery before the drain. Beanstalk’s postmortem speed mattered, but the protocol was already insolvent; cold-node guardian multisigs, pausable vaults, and pre-arranged response playbooks (freeze, comms, forensics retainers) are the difference between an incident and an extinction event.
FAQ
What is a flash loan, and why does it enable this?
A flash loan lends any amount with no collateral, provided borrowing and repayment occur within the same Ethereum transaction — atomicity is the collateral. Legitimate uses include arbitrage and liquidations; hostile uses include instantaneously owning voting majorities, manipulating oracle prices, or unwinding undercapitalised pools. In Beanstalk’s case the attacker borrowed a billion dollars, became the governance majority, drained the treasury, and repaid — all before the transaction closed, risking only gas fees.
Was this a hack or a legal exploit of the rules?
Technically the second, legally the first in every way that matters. No code bug was abused — the governance system executed its design faithfully — which is precisely why the incident redefined audit scope: a mechanism that permits borrowed-instant supermajorities with no execution delay is a defective design even when flawlessly implemented. Civil and criminal frameworks treat treasury theft via such manipulation as theft regardless of mechanical elegance; the elegance just made attribution and recovery (Tornado Cash routing) the practical barriers.
Did Beanstalk recover?
As a protocol, partially and slowly: the team ran a “Barn Raise” relaunch later in 2022, rebuilding with governance revisions (timelocks and voting safeguards among them), but the original depositors’ losses were not made whole beyond voluntary restructuring terms. The Beanstalk name survived as a case-study curriculum; its $182M drain remains the canonical flash-loan governance attack that every new protocol’s documentation cites in its threat-model section — the attack that needed no key, no bug, and no gun, just patience, preparation, and thirteen seconds.
