Beanstalk Hack
Incident Overview
A flash loan attack was occurred on Beanstalk Governance resulting in a theft of $77M.
The attacker was initially funded through Synapse bridge at:
https://etherscan.io/tx/0x1fb73ec5…75e101
Since the $BEAN contract’s governance actions have 1 day of delay, the attacker prepared the governance proposal in advance. Proposal #18 takes the whole contract’s value, while Proposal #19 transfers $250k to the Ukraine donation address. BIP18 is the name of this Ukraine proposal (instead of BIP19)
BIP18 proposal transaction:
https://etherscan.io/tx/0x3cb358d4…358967
The attacker’s contract that was used to perform a flash loan:
https://etherscan.io/address/0x1c5dcdd0…a10fb4
The transaction behind the flash loan:
https://etherscan.io/tx/0xcd314668…d33ad7
The flash loan was used to get:
- 350m DAI, 500m USDC and 150m USDT from Aave;
- 32m BEAN from Uniswap;
- 11.6M LUSD from SushiSwap.
These tokens were used to supplement the liquidity in Curve pools with BEAN for governance voting.
At first, the attacker minted 3CRV using DAI, USDC, and USDT. After, he generated the token BEAN3CRV-f using BEANS. This was followed by a deposit of 32 million $BEAN tokens and 25 million $LUSD into yet another contract to create a new token named BEAN3LUSD-f.
BEAN3CRV-f and BEAN3LUSD-f may be transformed straight into Seeds (a special type of asset called which acts like voting power in the system), providing the attacker with sufficient voting power. In reality, the attacker was able to manage more than 70% of the total number of Seeds thanks to the flash loan and $BEAN
The BIP18 triggers the execution of the designed code with the governance privilege to drain the pool fund:
https://etherscan.io/tx/0x68cdec0ac76454c3b0f7af0b8a3895db00adf6daaf3b50a99716858c4fa54c
During the attack transaction, 250,000 USDC was donated to the Ukraine Crypto Donation address.
$181 million was drained from Beanstalk, but the attacker only kept $76M, which were swapped on Ether and deposited into Tornado Cash mixer in a bunch of transactions:
https://bloxy.info/txs/transfers_from/0x1c5dcdd0…a10fb4?currency_id=1
Incident Report
Protocol Information
What the Attacker Needed to Succeed
Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.
What Auditors Should Check
If you're auditing a protocol with similar architecture to Beanstalk, these are the critical security checks that could have prevented this incident (April 2022).
- Verify all logic paths related to Flashloan Governance Attack / Flash Loan Attack are guarded by proper access controls and input validation - see the Flash Loans Attacks attack class for patterns
- Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs
Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.
Free TrialRelated Attack Classes
The technique used in this hack maps to these vulnerability classes in our security curriculum:
Proof-of-Concept Exploits
On-Chain Evidence & References
- Reference https://rekt.news/beanstalk-rekt/
- Post-Mortem https://medium.com/uno-re/beanstalk-farms-hacked-total-damage-is…
- Twitter/X Alert https://twitter.com/peckshield/status/1515680335769456640
- Block Explorer https://etherscan.io/tx/0x68cdec0ac76454c3b0f7af0b8a3895db00adf6…
- Block Explorer https://etherscan.io/tx/0xcd314668aaa9bbfebaf1a0bd2b6553d01dd588…
Sources & References
- 01
- 02
- 03
-
04
Reference https://rekt.news/beanstalk-rekt/
- 05
- 06
Learn to Prevent the Next Beanstalk
The Beanstalk hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.