ChainBleedv0.1 · open intel
← back to feed·ETHFLASHLOAN2022-04-17 · 4y ago
Incident · DEFILLAMA

Beanstalk

Flashloan Governance Attack
Estimated loss
$181.00M
VERDICT —AUDIT-CATCHABLE
Computing governance weight from spot deposit state without a snapshot/checkpoint is a known governance anti-pattern (Compound `getPriorVotes` was already standard practice). Any audit measuring 'can voting power be acquired atomically' would have flagged emergencyCommit as Critical.
▰ METHOD
Flashloan Governance Attack
FLASHLOANBYTECODE CATCHABLEAI SCANNABLE
Root cause

Beanstalk's on-chain governance (`GovernanceFacet` of the Diamond) tallied Stalk voting power from the current-block deposit state with no snapshot, no time-weighted average, and no flash-loan guard. The `emergencyCommit(uint32 bip)` path required only a 2/3 supermajority of Stalk and a 24-hour delay since BIP proposal — but the supermajority was computed against `silo().s.bip[bip].roots` measured at execution time. The attacker proposed BIP-18 (a malicious `init` function that approved transfers of Beanstalk's protocol assets to the attacker), waited the 24-hour proposal window, then in a single transaction: flash-loaned ~$1B in DAI/USDC/USDT from Aave + ~$32M BEAN + ~$12M LUSD, deposited LP into the Silo to mint ~79% of all Stalk, called `emergencyCommit(18)` which delegatecalled the malicious init, drained the BEAN3CRV and BEANLUSD pools, and repaid. Net to attacker: ~$76M after slippage; protocol loss ~$181M.

▰ PROOF OF CONCEPT
DEFIHACKLABS
src/test/2022-04/Beanstalk_exp.sol
view forked test on github ↗

Reproducible Foundry test fork from SunWeb3Sec/DeFiHackLabs. Clone the repo, run forge test against the file path above, and replay the exploit against a mainnet fork at the historical block. Use for reproduction only — not for live targets.

Forensic narrative

Classification: Ecosystem. Technique: Flashloan Governance Attack. Target type: DeFi Protocol. Affected chains: Ethereum. Implementation language: Solidity.

Primary source
https://www.halborn.com/blog/post/explained-the-beanstalk-hack-april-2022
Sourced from
DefiLlama Hacks dataset · api.llama.fi/hacks
Technical record
chain
ethereum
protocol
Beanstalk
bug_class
flashloan
date_occurred
2022-04-17
loss_usd
$181,000,000
classification
Ecosystem
technique
Flashloan Governance Attack
target_type
DeFi Protocol
language
Solidity
source_id
dl:631
Related — same bug class· flashloan
2026-05-11
1mo ago
POLY
Ink Finance
Contract Vulnerability
flashloan
$140.0K
UNRATED
2026-05-04
1mo ago
ETH
SmartCredit
Flashloan Exploit
flashloan
$72.0K
UNRATED
2026-05-04
1mo ago
SmartCredit
Flash Loan Exploit
flashloan
$72.0K
UNRATED
2026-04-28
1mo ago
BSC
JUDAO
Flashloan Exploit
flashloan
$228.0K
UNRATED
2026-04-28
1mo ago
JUDAO
Exploit
flashloan
$228.0K
UNRATED
2026-04-15
1mo ago
LootBot AI
Contract Vulnerability
flashloan
$9.6K
UNRATED
ChainBleed — live web3 threat intelligence