Yearn Finance Legacy Contract Exploited
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.
Yearn is a decentralized finance (DeFi) protocol that allows individuals, DAOs, and other protocols to earn yield on their digital assets. One of Yearn's core products is its Vaults, which are capital pools that generate yield based on market opportunities. Yearn's governance process is controlled by YFI token holders who submit and vote on off-chain proposals, with proposals that generate majority support being implemented by a 9-member multi-signature wallet. Recently, Yearn's yUSDT token contract was hacked due to a misconfiguration that had been present for over three years. The attacker was able to exploit the misconfiguration to manipulate the underlying share prices of yUSDT and mint a large quantity of yUSDT using just 10k USDT. The attacker was funded via Tornado Cash and deposited 1000 ETH for laundering. The attacker's first two addresses contain approximately $1.5M of assets each, and the third address contains 7.4M DAI.
About Yearn Finance
Yearn is a decentralized suite of DeFi products that enables individuals, DAOs, and other protocols to earn yield on their digital assets. The platform offers Yearn Vaults, which are capital pools that automatically generate yield based on market opportunities, automating the yield generation and rebalancing process while also socializing gas costs and automatically shifting capital as opportunities arise. End users do not need to have proficient knowledge of underlying protocols or DeFi to use the Vaults, making them a passive-investing strategy. Yearn Finance is DeFi's leading yield aggregator and is governed by YFI token holders who submit and vote on off-chain proposals that govern the ecosystem. Proposals that generate majority support are implemented by a 9-member multi-signature wallet, and changes must be signed by 6 out of the 9 wallet signers to be implemented[1][2][3].
"Considered by many as one of DeFi’s most reliable, secure platforms, Yearn made it’s name by offering some of the sector’s simplest farming opportunities."
"Yearn is a decentralized suite of products helping individuals, DAOs, and other protocols earn yield on their digital assets."
"Yearn Finance is DeFi’s premier yield aggregator. Giving individuals, DAOs and other protocols a way to deposit digital assets and receive yield."
"The protocol is maintained by various independent developers and is governed by YFI holders. You can find brief descriptions of Yearn's core products, the governance process, and links to active communication channels below."
"Vaults. Yearn Vaults are capital pools that automatically generate yield based on opportunities present in the market. Vaults benefit users by socializing gas costs, automating the yield generation and rebalancing process, and automatically shifting capital as opportunities arise. End users also do not need to have proficient knowledge of the underlying protocols involved or DeFi, thus the Vaults represent a passive-investing strategy."
"Governance. The Yearn ecosystem is controlled by YFI token holders who submit and vote on off-chain proposals that govern the ecosystem. Proposals that generate majority support (>50% of the vote) are implemented by a 9-member multi-signature wallet. Changes must be signed by 6 out of the 9 wallet signers to be implemented. The members of the multi-signature wallet were voted in by YFI holders and are subject to change from future governance votes. Please refer to the multisig documentation for the list of multisig signers. For more info about the governance process, please consult the Governance FAQ and YIP-61: Governance 2.0."
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.
| Date | Event | Description |
|---|---|---|
| April 12th, 2023 11:52:35 PM MDT | First Attack Transaction | One of the attack transactions[4]. |
| April 13th, 2023 1:42:00 AM MDT | BlockSec Twitter Analysis | BlockSec publishes an analysis of the exploit to Twitter[5]. |
| April 13th, 2023 3:14:00 AM MDT | MetaSleuth Shares Analysis | Twitter user MetaSleuth shares an analysis to Twitter[6], including a Google Sheet which he set up to track the total protocol loss[7]. |
| April 13th, 2023 12:27:00 PM MDT | RektHQ Published Article | RektHQ publishes an article on the exploit[8][9]. |
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?
BlockSecTeam Analysis
BlockSecTeam posted an initial analysis to Twitter[5].
"@iearnfinance was hacked with two consecutive attack transactions. The root cause is due to an (on-purpose?) misconfiguration which makes the rebalance of the pools rely on an incorrect underlying token. This misconfiguration has been there for more than three years."
Other Analysis
TBD need to attribute these[8].
"The immutable yUSDT contract that was attacked was deployed over three years ago, back when Yearn was Andre Cronje’s iearn finance.
While the strategy was superceded by newer versions, plenty of funds still remained in the original contract. Later Yearn vault contracts are not affected."
"Despite a last-minute warning on Twitter, immutable contracts can’t be saved."
"Team member storming0x acknowledged the attack before Yearn reassured users that current contracts were unaffected."
"1156 days to spot a multimillion dollar vulnerability in one of DeFi’s longest established protocols."
"The attacker exploited a misconfiguration in the iearn yUSDT token contract.
The token generated yield via an underlying basket of yield-bearing tokens, including USDT positions on Aave, Compound, DYDX and BzX’s Fulcrum.
However, since launch, the yUSDT has contained what appears to be a copy/paste error whereby the Fulcrum USDC address was used instead of the Fulcrum USDT contract.
The exploiter was able to take advantage of the misconfiguration to vastly manipulate the underlying share prices of yUSDT, and mint a large quantity (1.2 quadrillion) of yUSDT using just 10k USDT."
"The attacker was funded via Tornado Cash and redeposited 1000 ETH for laundering. At the time of writing, the first two exploiter addresses contain approximately $1.5M of assets each, and address 3 contains 7.4M DAI."
Total Amount Lost
The total amount lost has been estimated at $11,400,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
There do not appear to have been any funds recovered in this case.
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
The vulnerabilities were known for multiple years. Better education and awareness is needed to stop using vulnerable smart contracts.
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
- ↑ Yearn Finance Homepage (May 3, 2023)
- ↑ Yearn.finance Docs - Yearn Finance (May 3, 2023)
- ↑ Introduction - Yearn Finance Documents (Jan 8, 2022)
- ↑ Ethereum Attack Transaction - Etherscan (May 3, 2023)
- ↑ 5.0 5.1 BlockSecTeam - "The root cause is due to an (on-purpose?) misconfiguration which makes the rebalance of the pools rely on an incorrect underlying token." - Twitter (May 3, 2023)
- ↑ MetaSleuth - "@iearnfinance was hacked and the loss is around 11.4 million USD. The exploiter is actively converting the profits into stablecoins and has already laundered 1000 Ether into @TornadoCash." - Twitter (May 3, 2023)
- ↑ iearn yUSD exploit loss and current status - Google Sheets (May 3, 2023)
- ↑ 8.0 8.1 Rekt - Yearn - REKT 2 (May 3, 2023)
- ↑ RektHQ - "1156 days to spot an eight-figure vulnerability in one of DeFi’s best known protocols." - Twitter (May 3, 2023)
Cite error: <ref> tag with name "metasleuthtwitter-10758" defined in <references> is not used in prior text.