
Briefing
The Yearn Finance protocol suffered a significant economic exploit targeting its legacy yETH stableswap pool, resulting in a direct loss of user funds. This breach was a result of a critical logic vulnerability within the pool’s custom token minting function, which allowed a malicious actor to create an effectively infinite supply of the yETH token. The attacker subsequently swapped these worthless tokens for real assets, draining the entire pool’s liquidity in a single, atomic transaction. The total quantifiable loss from this sophisticated smart contract exploit is approximately $9 million.

Context
The prevailing risk factor for established DeFi protocols is the operational maintenance of legacy smart contracts, which often contain complex, custom logic that predates modern auditing standards. This incident leveraged a known class of vulnerability → the failure to properly decommission or fully secure older contracts that remain integrated into the protocol’s architecture. The complexity of combining liquid staking derivatives (LSTs) with custom swap code also introduced an unmitigated attack surface.

Analysis
The attack vector was a precision manipulation exploit rooted in the yETH stableswap pool’s custom logic for calculating the token’s exchange rate or “rate-update” function. The attacker exploited a flaw in the mint function, which did not correctly validate the input or the resulting token supply, enabling the creation of over 235 trillion yETH tokens. By injecting this massive, fraudulently minted supply, the attacker was able to artificially inflate the token’s value within the pool’s internal accounting. This manipulation allowed them to redeem all genuine underlying assets (ETH and LSTs) from the pool in a single, atomic transaction, demonstrating a failure of the contract’s invariant checks to prevent the state change.

Parameters
- Total Financial Loss → ~$9 Million USD – The estimated value of assets drained from the affected pools.
- Vulnerability Type → Infinite Token Minting Flaw – A critical logic error in the legacy yETH contract’s mint function.
- Stolen Funds Route → ~1,000 ETH to Tornado Cash – The initial amount of the stolen funds routed to a mixer for obfuscation.
- Affected Component → Legacy yETH Stableswap Pool – The specific, older smart contract isolated from the protocol’s V2/V3 infrastructure.

Outlook
Immediate mitigation for users involves confirming that their assets are not staked in or approved for interaction with any legacy or unaudited contracts. For the wider ecosystem, this incident mandates an aggressive, systemic review of all non-core, legacy contracts and the immediate implementation of a formal decommissioning or migration plan for all V1/V2 infrastructure. The new security best practice will emphasize the necessity of rigorous, formal verification for any custom stableswap or pricing logic, especially when integrating volatile liquid staking derivatives.

Verdict
This $9 million exploit confirms that the greatest systemic risk in mature DeFi protocols remains the operational security posture around unmigrated, complex legacy contracts.
