Worked example · 2022-07
Yam Finance — an attacker staked bought YAM liquidity to gain voting power, put an unverified-code proposal to a quorum vote and withdrew the stake; the guardians cancelled it before execution — Yam DAO / Ethereum — 2022-07-09
Summary
On 2022-07-09 an attacker, funded from Tornado Cash two days earlier, used a set of wallets and an unverified contract to create a Yam governance proposal and vote it past quorum with 224,739 BoU YAM (about 561,847 YAM) staked through the Sushiswap-LP incentivizer (post-mortem). Ethereum security community members alerted the YAM Guardians; because the proposal held unverified, unknown code it was judged potentially malicious, and because the proposer had pulled its stake the guardians could cancel it at 12:41 UTC. The Yam team said "Earlier today, there was a governance attack on the DAO that has been thwarted" (Decrypt). This is separate from the 2020 rebase bug.
Timeline (UTC)
Stages: Preparation (funding, buying voting power) → Execution (proposal and vote) → Exit (stake withdrawn) → Response (alert, cancel). Times are from the post-mortem unless stated.
| When | What happened | OAK |
|---|---|---|
| 2022-07-07 17:54 to 18:42 | Wallet A funded with 200 ETH from Tornado Cash in 2 transactions; 135 ETH sent on to wallet B. | T7.001 |
| 2022-07-07 19:01 to 21:28 | Wallet B sells 57 ETH for YAM, adds ETH and YAM to the Sushiswap pool and stakes the LP tokens in the Yam Incentivizer. | T16.002 |
| 2022-07-09 07:41 to 08:50 | Wallet A funds wallets C and D; wallet C buys YAM and adds liquidity; wallet D deploys the unverified attacker contract (08:36); B and C send LP tokens to it. | T16.002 |
| 2022-07-09 09:06 | Attacker contract stakes the LP tokens in the Incentivizer. | T16.002 |
| 2022-07-09 09:08 to 09:09 | Wallet D, through the contract, creates the proposal and votes with 224,739 BoU YAM; quorum is 200,000 BoU YAM. Decrypt notes a spam-like description beginning "Contributors comps for May, backpay for VDM". | T16.002 |
| 2022-07-09 09:15 to 09:28 | Contract withdraws the LP tokens to wallet B, which unwinds them and sells the YAM for about 50.7 ETH. | — |
| 2022-07-09 (morning, US Eastern per post-mortem) | Ethereum security community members alert the YAM Guardians; proposal judged potentially malicious. | response |
| 2022-07-09 12:41 | Guardians cancel the proposal. The guardian multisig was not needed to move treasury funds. | response |
| After 2022-07-09 12:41 | Attacker sells its remaining YAM and sends the ETH to Tornado Cash from wallet B. Amounts: undisclosed. | T7.001 |
| 2022-07-09 to 2022-07-10 | Yam announces the thwarted attack on X (July 9 per Decrypt); The Block reports on July 10 that it resembled an attempt in December 2021. | response |
Key addresses (from the post-mortem; the post-mortem's Etherscan link for wallet C points at wallet B, so C is linked by its own address):
- Attacker wallet A —
0x4429abbf523bef0f1e934b04cff8584955c72548 - Attacker wallet B —
0x0DE41bDc58FfAF4A8c1b7084a544fBBe10a9DE56 - Attacker wallet C —
0x3C749D3fCE03eE5d7Ff43fF09C9e07E9807E51f0 - Attacker wallet D —
0x0946969bc3BE7e9B436a399C55dD3ffb029B0e95 - Attacker contract (unverified) —
0x15515330e7C003dD4594b737165F2bf2EE671D82 - Yam Governor —
0x2da253835967d6e721c6c077157f9c9742934aea - Yam Incentivizer —
0xd67c05523d8ec1c60760fd017ef006b9f6e496d0 - Yam Treasury —
0x97990b693835da58a281636296d2bf02787dea17 - Yam Timelock —
0x8b4f1616751117c38a0f84f9a146cca191ea3ec5
Fund flow: no funds were taken from the DAO. The attacker's own ETH flow (Tornado Cash in, about 50.7 ETH from the first sale, Tornado Cash out) is described above without amounts for the exit; an on-chain trace was not done.
Root-cause evidence
- Technique: OAK-T16.002
- Source: https://gist.github.com/rossgalloway/e7d28830b66ea0fcf9bbd4bb9cd6f46b; https://decrypt.co/104848/yam-finance-safeguards-3-1m-treasury-governance-attack; https://www.theblock.co/post/156796/yam-finance-thwarts-governance-attack-aimed-at-hijacking-its-treasury
- Source type: operator
- Confidence: corroborated
- Evidence: The post-mortem is a cleaned-up copy, by a third party, of an earlier Yam contributor post-mortem; the original gist is not opened here. It gives the full wallet, transaction and timing chain and the reason cancellation was possible. Decrypt and The Block (relayed through a summarising fetch; the page was not checked word for word) agree on the proposal, the roughly $3.1M treasury and the cancel. Unknown: what the unverified proposal code would have done (The Block says it would have moved the reserves to an attacker wallet; the post-mortem only says the code was unverified and unknown), the proposal number, and who alerted the guardians. Technique fit is by attempt: the payload was never executed. A September 2026 proposal on the same governor is reported by crypto.news but is a different event and not covered here.
Public references
[yamgist2022]— Ross Galloway (cleaned-up copy of the Yam contributor post-mortem), "July 9th 2022 Governance Attack Postmortem": https://gist.github.com/rossgalloway/e7d28830b66ea0fcf9bbd4bb9cd6f46b[decrypt2022yam]— Decrypt, "Yam Finance Safeguards $3.1M Treasury From Governance Attack" (2022-07-11): https://decrypt.co/104848/yam-finance-safeguards-3-1m-treasury-governance-attack[theblock2022yam]— The Block, "Yam Finance thwarts governance attack aimed at hijacking its treasury" (2022-07-10): https://www.theblock.co/post/156796/yam-finance-thwarts-governance-attack-aimed-at-hijacking-its-treasury