Table of Contents
- 1 Introduction
- 2 Key Details of the Attack
- 3 Attack Details
- 4 Attack Transactions
- 5 Funds Transfer
- 6 Impact
- 7 Hack Response by Harvest Finance
- 8 Bounty for Return of Funds
- 9 Return of Funds
- 10 Conclusion
This comprehensive report delves into the Harvest Finance fund theft incident that transpired on October 26, 2020.
The attack targeted Harvest Finance’s USDC and USDT vaults, exploiting vulnerabilities related to arbitrage and impermanent loss within the Curve.fi Y pool and stealing ~$24M.
This report provides a detailed account of the attack, the attacker’s actions, the response by Harvest Finance, and the impact on the platform and its native token, FARM.
Key Details of the Attack
Date: October 26, 2020
Time: 02:53:31 AM +UTC
The attacker utilized a fresh Ethereum address, 0xf224ab004461540778a914ea397c589b677e27bb, to carry out the attack.
Funds for Attack
The attacker sourced 10 ETH for the attack through a Tornado transaction: 0x4b7b9e387a79289720a0226f695913d1d11dbdc681b7218a432136cc089363c4.
Initial Attack Transaction
The attack was initiated in transaction 0x35f8d2f572fceaac9288e5d462117850ef2694786992a8c3f6d02612277b0877
The attacker capitalized on the following mechanics of the Harvest Finance protocol:
- Real-time Asset Value Calculation: The protocol calculated real-time asset values to determine user shares and payouts.
- Shared Pools: USDC and USDT assets were part of shared pools, making them vulnerable to market effects like impermanent loss and arbitrage.
The attacker’s actions during the attack included:
The attacker skillfully leveraged the impermanent loss experienced by USDC and USDT assets within the Curve.fi Y pool, orchestrating a series of strategic moves to exploit these vulnerabilities within the Harvest Finance ecosystem.
Here’s a breakdown of the attack:
Attacker’s Identity and Preparation
- The attacker’s wallet address was 0xf224ab004461540778a914ea397c589b677e27bb.
- They deployed a contract, 0xc6028a9fa486f52efd2b95b949ac630d287ce0af, to execute the entire attack on October 26, 2020, at 02:53:31 AM +UTC.
- To fund the attack, 10 ETH was sourced through a Tornado transaction, specifically identified as 0x4b7b9e387a79289720a0226f695913d1d11dbdc681b7218a432136cc089363c4.
Initiation of the Attack
- The attack commenced with transaction 0x35f8d2f572fceaac9288e5d462117850ef2694786992a8c3f6d02612277b0877.
- Within this single transaction, the attacker orchestrated a series of steps:
- Obtaining a substantial amount of USDT (18,308,555.417594) and USDC (50,000,000) from Uniswap and depositing them into the attacking contract.
- Executing a swap within the Y pool, converting 17,222,012.640506 USDT into USDC. This swap caused an increase in the USDC’s value inside the Y pool, as other assets suffered impermanent loss. The smart contract secured approximately 17,216,703.208672 USDC in this process.
- Depositing 49,977,468.555526 USDC into Harvest’s USDC vault, obtaining a total of 51,456,280.788906 fUSDC at a rate of 0.97126080216 USDC per share. Notably, this action devalued the share price by approximately 1%. The arbitrage check within Harvest’s strategy did not trigger, as it did not exceed the 3% threshold, allowing the transaction to proceed.
- Converting 17,239,234.653146 USDC back into USDT within the Y pool, resulting in a return to the original, lower USDC value within the Y pool due to the reversal of the impermanent loss effect. The attacker received 17,230,747.185604 USDT.
- Finally, the attacker withdrew from Harvest’s USDC vault, exchanging all fUSDC shares for 50,596,877.367825 USDC. The share price at this point had dropped to 0.98329837664 USDC due to the decreased USDC value within the Y pool.
Notably, the USDC used in this withdrawal came entirely from the buffer of the Harvest’s USDC vault, with no interaction with the Y pool. The net profit from this operation, without accounting for flash loan fees, amounted to 619,408.812299 USDC. The attacker repeated this process multiple times within the same transaction.
The attacker’s meticulous execution of these steps allowed them to take advantage of the market dynamics and impermanent loss within the Y pool, ultimately generating substantial profits.
The attacker executed a total of 17 attack transactions targeting the USDC vault within 4 minutes and 13 transactions targeting the USDT vault within another 3 minutes.
One of the txns: 0x0fc6d2ca064fc841bc9b1c1fad1fbb97bcea5c9a1b2b66ef837f1227e06519a6
At the conclusion of the attack, the attacker transferred 13,000,000 USDC and 11,000,000 USDT from the attacking contract to address 0x3811765a53c3188c24d412daec3f60faad5f119b in
In Txn: 0x25119cd54a4562aa427d9770af383512f9cb5e8e4d17232ad96b69dc293a3510, a portion of the ill-gotten gains was returned to the Harvest deployer. This transaction involved the transfer of 1,761,898.396474 USDC and 718,914.048541 USDT.
The share price of the USDC vault decreased by 13.8%, and the USDT vault share price dropped by 13.7%.
FARM Token Price
The exploit caused the platform’s native token, FARM, to plummet by 65% within an hour.
Total Value Locked (TVL)
The project’s Total Value Locked (TVL) dropped from over $1 billion before the attack to $430 million.
The attack resulted in a total loss of approximately $33.8 million, equivalent to 3.2% of the protocol’s total value locked before the attack.
Hack Response by Harvest Finance
Harvest Finance swiftly responded by withdrawing all funds from shared pools, including DAI, USDC, USDT, TUSD, WBTC, and renBTC. Depositors in vaults unaffected by the attack (DAI, TUSD, WBTC, renBTC) remained unscathed.
Bounty for Return of Funds
A bounty of $100,000 was offered to anyone who aided in the return of the stolen funds. If the return is executed within 36 hours, the bounty increases to $400,000.
Notably, the community and parties involved were urged not to engage in doxxing the attacker and to focus on ensuring the successful return of user funds.
Return of Funds
Remarkably, approximately $2.5 million was sent back to the Harvest Finance contract. The developer team announced its intention to distribute these funds pro rata to affected users.
The log of transactions pertaining to the attack is visible on the attacker’s address 0xf224ab004461540778a914ea397c589b677e27bb.
The Harvest Finance fund theft incident marked a significant breach in the protocol, resulting in substantial financial losses and a considerable drop in FARM token value.
Harvest Finance responded promptly, taking measures to secure its assets and initiate remediation for affected users.