Yearn Finance Hack

Reported loss $11.0M
Ethereum
Manipulate Curve 3pool composition, force yDAI strategy deposits at an unfavorable rate, then redeem attacker-owned 3CRV

What happened

On February 4, 2021, an attacker exploited Yearn's v1 yDAI vault on Ethereum by manipulating Curve 3pool's stablecoin balance and forcing the vault's strategy to deposit at a poor exchange rate. About 11 million DAI left the vault, while Yearn estimated the attacker's own profit at 2.7 million DAI.

Technical root cause

The strategy accepted a same-transaction, externally manipulable Curve 3pool exchange rate for a large single-sided investment. A 1% slippage tolerance was too loose, the normal 0.5% withdrawal fee had been set to zero for v2 migration, and the public earn() method let any caller force the vulnerable strategy investment.

How it happened

The attacker obtained temporary large liquidity and deposited USDC and DAI into Curve 3pool, receiving 3CRV. They then withdrew USDT, deliberately leaving 3pool heavily skewed toward DAI and USDC. Because the v1 vault allowed a caller to invoke earn(), they repeatedly deposited DAI into yDAI, causing StrategyDAI3pool to invest the vault's DAI in the deliberately imbalanced pool at an unfavorable rate.

The attacker restored the pool with USDT, withdrew yDAI, then recreated the skew. In the final cycle, they redeemed their earlier 3CRV position and captured about 2.7 million DAI, while the broader vault loss totalled 11 million DAI. Yearn stopped further strategy deposits within minutes. Its later treasury-funded vault restoration is not represented as recovery of attacker funds.

Protocol details

Classification Flash-Loan-Assisted Curve 3pool Exchange-Rate Manipulation / Forced Investment
Protocol Type Yield Aggregator
Affected asset / contract YFI
Implementation language Solidity
Protocol links Website @iearnfinance

Security review history

Funds Recovery

15.5%

Recovered

$1.7M

Net Loss

$9,295,000

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.