OAK — OnChain Attack Knowledge

Worked example · 2023-04

Yearn iearn yUSDT — token contract wired to the Fulcrum iUSDC token instead of iUSDT, so a small deposit minted a huge supply of yUSDT — Yearn iearn legacy protocol / Ethereum — 2023-04-13

Loss
~$11.6M, per PeckShield as relayed by The Block, which says this was PeckShield's latest estimate. CertiK gives about $10M and Halborn about $10M. The exploiter swapped the minted yUSDT for DAI, USDC, BUSD, TUSD and USDT, per The Block.
Recovery
undisclosed in the opened sources.
OAK Techniques observed
OAK-T9.016 (Contract Accounting / State-Invariant Flaw — primary). The yUSDT contract was configured against the wrong underlying token, so its share accounting did not match what it held (CertiK). See techniques/T9.016-contract-accounting-state-invariant-flaw.md. OAK-T7.001 (Mixer-Routed Hop — the attacker began withdrawing ETH through Tornado Cash, per Decrypt). The earlier version of this file also listed T9.002 (flash loan); no opened source says a flash loan was used, so it is dropped.
Attribution
pseudonymous. No opened source names or attributes the attacker; no attacker address is printed in any opened page.
Key teaching point
A deprecated contract that still holds funds or can still mint is live attack surface, and its configuration needs the same review as a current one. The yUSDT contract had been misconfigured since deployment about three years earlier (The Block), and nothing was reviewing it.

Summary

On 2023-04-13 an exploit hit yUSDT, the USDT token of Yearn's early "iearn" protocol (Decrypt). Researcher samczsun said yUSDT pointed at the Fulcrum iUSDC token instead of the iUSDT token (The Block); CertiK states the same ("the Fulcrum iUSDC token was used in place of the Fulcrum iUSDT token"). PeckShield, relayed by The Block, said the attacker minted 1.2 quadrillion yUSDT from roughly $10,000. Halborn describes the same deposit of 10,000 USDT and calls the wrong address a "copy-paste error". The attack used Aave V1 to carry out many swaps; Aave said V1 was not exploited (The Block, Decrypt). Yearn contributor Storm Blessed 0x said the issue seemed isolated to the iearn legacy protocol and liquidity pool, and that "Yearn v2 vaults seem not to be impacted" (Decrypt).

Timeline (UTC)

Stages: Flaw (config wrong since deployment), Take (mint and swap out), Money (Tornado Cash), Response (Yearn statement). No opened source gives times of day or transaction hashes; those are undisclosed here.

When What happened OAK
About 2020 (deployment) yUSDT is deployed pointing at the Fulcrum iUSDC token instead of iUSDT; samczsun says it was broken "since deploy", over 1,000 days earlier (Decrypt) T9.016
2023-04-13 (time undisclosed) The attacker deposits about $10,000 and mints 1.2 quadrillion yUSDT, per PeckShield (The Block). Transaction hashes undisclosed T9.016
2023-04-13 (time undisclosed) The minted yUSDT is swapped for DAI, USDC, BUSD, TUSD and USDT, using Aave V1 for many of the swaps (The Block) T9.016
2023-04-13 (time undisclosed) The attacker begins withdrawing ETH through Tornado Cash; PeckShield reports 1,000 ETH (about $1.9M) at the time of reporting (Decrypt) T7.001
2023-04-13 Yearn contributor says the issue looks isolated to the legacy iearn protocol and pool and that contributors are investigating (Decrypt) response

Key addresses:

Root-cause evidence

Public references

Techniques demonstrated (2)

More incidents