Yearn Finance Hack

From Quadriga Initiative Cryptocurrency Hacks, Scams, and Frauds Repository
Jump to navigation Jump to search

Notice: This page is a freshly imported case study from the original repository. The original content was in a different format, and may not have relevant information for all sections. Please help restructure the content by moving information from the 'About' and 'General Prevention' sections to other sections, and add any missing information or sources you can find. If you are new here, please read General Tutorial on Wikis or Anatomy of a Case Study for help getting started.

Notice: This page contains sources which are not attributed to any text. The unattributed sources follow the initial description. Please assist by visiting each source, reviewing the content, and placing that reference next to any text it can be used to support. Feel free to add any information that you come across which isn't present already. Sources which don't contain any relevant information can be removed. Broken links can be replaced with versions from the Internet Archive. See General Tutorial on Wikis, Anatomy of a Case Study, and/or Citing Your Sources Guide for additional information. Thanks for your help!

Yearn Finance

The Yearn Finance project was exploited, and the hacker made off with $2.7m, out of $11m removed from the platform. Had the team not reacted quickly to fix the issue within 10 minutes, the damage could have been far worse.

This is a global/international case not involving a specific country.[1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19][20][21][22][23][24]

About Yearn Finance

"Yearn Finance is a suite of products in Decentralized Finance (DeFi) that provides lending aggregation, yield generation, and insurance on the Ethereum blockchain. The protocol is maintained by various independent developers and is governed by YFI holders."

"Yearn Finance, the yield aggregation protocol founded by Andre Cronje, has been hacked. One of the platform’s so-called vaults lost $11M, and the attacker got away with $2.8M."

"Yearn v1 yDAI vault was attacked and the attackers stole 2.8 million US dollars. Banteg, the core developer of Yearn finance, subsequently stated that the attacker received 2.8 million US dollars and vault lost 11 million US dollars. During the investigation period, deposits into v1 DAI, TUSD, USDC, USDT vault will be prohibited." "[T]he attack’s nature could be categorized as an arbitrage. The hacker used a flash loan to borrow millions in crypto assets, use those assets as collateral to borrow more crypto, then repeatedly deposited those borrowed assets in a Yearn pool. The exploit consisted in manipulating the Dai rate in the pool, and benefitting from that rate by exchanging the liquidity provider tokens earned for stablecoins."

"The hacker took out a series of flash loans from dYdX and Aave, then used the funds as collateral for another loan on Compound. In doing this, the attacker essentially gamed the exchange rates on Yearn to accumulate CRV tokens to sell for stablecoins."

"At a high level, the exploiter was able to profit through the following steps: (1) Debalance the exchange rate between stablecoins in Curve's 3CRV pool. (2) Make the yDAI vault deposit into the pool at an unfavorable exchange rate. (3) Reverse the imbalance caused in step 1. This pattern was repeated in a series of 11 transactions executed over 38 minutes before being mitigated."

"At 21:45 (UTC), Andre Cronje notices the complex transaction pattern of a contract that is interacting with Yearn vaults. Yearn's security team is called into action, and what eventually is determined to be an active exploit on Yearn's v1 yDAI vault, is mitigated 11 minutes later."

"The fast response leads to 24m DAI out of the vault's total 35m DAI AUM being saved, with 11m DAI being lost as part of the exploit. The profit of the exploiter is estimated to be 2.7m DAI."

"yearn.finance reports that a confluence of three factors led to the vulnerability. “[First], the hacked vault’s slippage protection was set too loose at 1%. [Second], the normal 0.5% withdrawal fee was set to 0%, to encourage migrations to v2 vaults without incurring costs. [And third], this being a v1 vault, the exploiter was able to call earn() and push deposits into the vault’s strategy at will.”"

"The hack brought sarcastic comments hailing DeFi as “the future of finance,” as well as people questioning open finance’s uncensorable nature considering Yearn deposits were disabled, not entirely different from Robinhood’s limiting of GME stock purchases last week."

"Still, others applauded the team’s quick reaction: it took 10 minutes and 14 seconds according to lead developer Banteg to mitigate the issue, a process which needed multiple players due to the multi-sig quorum required to modify the smart contracts." "By applying setMin(0) to the yDAI vault, deposits into the strategy were effectively disabled, preventing further exploits from taking place."

"Not everyone is unhappy either: other liquidity providers who staked on Curve’s 3pool received $3.5M in total. In response, Tether has frozen the 1.7M USDT stolen in the attack, again casting a shadow on just how decentralized crypto really is. All eyes now wait for the Yearn team’s postmortem."

"The team at Yearn.Finance has released a detailed post-mortem report regarding the recent exploit. Tether Ltd, the world’s largest stablecoin issuer, has also frozen $1.7 million in USDT that was allegedly involved in this security breach, Tether CTO Paolo Ardoino confirmed."

"Yearn announced Tuesday that they opened a Maker vault with YFI tokens from the treasury and minted 9.7 million DAI tokens from the vault to keep the yDAI vault intact. Using borrowed money allows the project to reimburse users without taking a hit to the treasury, either due to possible YFI appreciation or by gradually repaying the debt with protocol revenue. The team said that this is a one-off occurrence, as they expect users to hedge their own risks by purchasing coverage from Yearn ecosystem member Cover, which also got hacked recently."

This is a global/international case not involving a specific country.

The background of the exchange platform, service, or individuals involved, as it would have been seen or understood at the time of the events.

Include:

  • Known history of when and how the service was started.
  • What problems does the company or service claim to solve?
  • What marketing materials were used by the firm or business?
  • Audits performed, and excerpts that may have been included.
  • Business registration documents shown (fake or legitimate).
  • How were people recruited to participate?
  • Public warnings and announcements prior to the event.

Don't Include:

  • Any wording which directly states or implies that the business is/was illegitimate, or that a vulnerability existed.
  • Anything that wasn't reasonably knowable at the time of the event.

There could be more than one section here. If the same platform is involved with multiple incidents, then it can be linked to a main article page.

The Reality

This sections is included if a case involved deception or information that was unknown at the time. Examples include:

  • When the service was actually started (if different than the "official story").
  • Who actually ran a service and their own personal history.
  • How the service was structured behind the scenes. (For example, there was no "trading bot".)
  • Details of what audits reported and how vulnerabilities were missed during auditing.

What Happened

The specific events of the loss and how it came about. What actually happened to cause the loss and some of the events leading up to it.

Key Event Timeline - Yearn Finance Hack
Date Event Description
February 4th, 2021 Main Event Expand this into a brief description of what happened and the impact. If multiple lines are necessary, add them here.

Technical Details

This section includes specific detailed technical analysis of any security breaches which happened. What specific software vulnerabilities contributed to the problem and how were they exploited?

Total Amount Lost

The total amount lost has been estimated at $11,000,000 USD.

How much was lost and how was it calculated? If there are conflicting reports, which are accurate and where does the discrepancy lie?

Immediate Reactions

How did the various parties involved (firm, platform, management, and/or affected individual(s)) deal with the events? Were services shut down? Were announcements made? Were groups formed?

Ultimate Outcome

What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?

Total Amount Recovered

The total amount recovered has been estimated at $11,000,000 USD.

What funds were recovered? What funds were reimbursed for those affected users?

Ongoing Developments

What parts of this case are still remaining to be concluded?

General Prevention Policies

In general, it's impossible to know that a decentralized smart contract is secure. We can only know that an exploit either doesn't exist or hasn't been exploited yet.

On the other hand, offline multi-signature wallets have a known security model where multiple trusted individuals must sign for the release of funds. This sets their security to be the combined security of all signatories required to release the funds.

Individual Prevention Policies

No specific policies for individual prevention have yet been identified in this case.

For the full list of how to protect your funds as an individual, check our Prevention Policies for Individuals guide.

Platform Prevention Policies

Policies for platforms to take to prevent this situation have not yet been selected in this case.

For the full list of how to protect your funds as a financial service, check our Prevention Policies for Platforms guide.

Regulatory Prevention Policies

No specific regulatory policies have yet been identified in this case.

For the full list of regulatory policies that can prevent loss, check our Prevention Policies for Regulators guide.

References

  1. Rekt - Leaderboard (May 13, 2021)
  2. Rekt - Yearn - REKT (May 16, 2021)
  3. 2021's First Major DeFi Hack Explained (May 18, 2021)
  4. SlowMist Hacked - SlowMist Zone (May 18, 2021)
  5. Hacker Spends $8.3 Million in Fees to Attack Yearn Finance | Crypto Briefing (May 18, 2021)
  6. Yearn.Finance puts expanded treasury to use by repaying victims of $11M hack (May 18, 2021)
  7. DeFi Platform Yearn.Finance's DAI Vault Suffers Major Exploit, Hack Leads to $11 Million in Value Drained from Platforms (May 18, 2021)
  8. yearn-security/2021-02-04.md at master · yearn/yearn-security · GitHub (May 18, 2021)
  9. Yearn Finance DAI Vault 'Has Suffered an Exploit'; $11M Drained - CoinDesk (May 18, 2021)
  10. Paying Claims For The Yearn Hack (Jun 26, 2021)
  11. @NexusMutual Twitter (Jun 26, 2021)
  12. blocksec-incidents/2021.md at main · openblocksec/blocksec-incidents · GitHub (Aug 11, 2021)
  13. The Ydai Incident Analysis Forced Investment (Aug 11, 2021)
  14. Slowmist A Brief Analysis Of Yearn Finance Being Hacked (Aug 11, 2021)
  15. Explained: Inside the Yearn v1 yDAI Hack (Feb 2021) - Halborn (Aug 11, 2021)
  16. security/2021-02-05-Yearn.md at master · OriginProtocol/security · GitHub (Aug 11, 2021)
  17. Ethereum Transaction Hash (Txhash) Details | Etherscan (Aug 11, 2021)
  18. Tether Freezes $1.7 Million in Profits From Yearn Finance Hack - Decrypt (Aug 11, 2021)
  19. Comprehensive List of DeFi Hacks & Exploits - CryptoSec (Jan 8, 2022)
  20. $11 Million Gone in Yearn Finance Exploit - Decrypt (Jan 8, 2022)
  21. yearn.finance (Jan 8, 2022)
  22. https://docs.yearn.finance/getting-started/intro (Jan 8, 2022)
  23. Yearn Finance suffers exploit, says $2.8 million stolen by attacker out of $11 million loss (Feb 8, 2022)
  24. Yearn Finance DAI Vault 'Has Suffered an Exploit'; $11M Drained - CoinDesk (Feb 8, 2022)