Stolen 130 million US dollars to attract scumbag physique? Cream Finance hacked for the fifth time this year
成都链安
2021-10-28 11:07
本文约2450字,阅读全文需要约10分钟
Cream Finance can be said to be the most "declining" DeFi project of the year.​

#1 Event Overview

#1 Event Overview

How the attack occurs Event overview

About $130 million was stolen! Cream Finance was hacked for the fifth time this year, maybe it really has the physique to attract "scumbags".

#2 Event Specific Analysis

#2 Event Specific Analysis

Attack contract:

attacker:

0x24354d31bc9d90f62fe5f2454709c32049cf866b

Attack contract:

0x961d2b694d9097f35cfffa363ef98823928a330d

0xf701426b8126BC60530574CEcDCb365D47973284

transaction hash:

0x0fe2542079644e107cbf13690eb9c2c65963ccb79089ff96bfaf8dced2331c92

1. The first step is through flash loan from

DssFlash (0x1eb4cf3a948e7d72a198fe073ccb8c7a948cd853) contract borrowed 500,000,000DAI.

2. Put DAI into yDAI

(0x16de59092dae5ccf4a1e6439d611fd0653f0bd01) is mortgaged in the contract in exchange for 451,065,927.891934141488397224yDAI.

3. Place the exchange for yDAI tokens on Curve.fi: y Swap

(0x45f783cce6b7ff23b2ab2d70e416cdb7d6055f51) to add liquidity and get 447,202,022.713276945512955672yDAI+yUSDC+yUSDT+yTUSD.

4. Then the

447,202,022.713276945512955672yDAI+yUSDC+yUSDT+yTUSD mortgage and get 446,756,774.416766306389278551yUSD.

5. Then call the minting function in crYUSD to mint 22,337,774,341.38713187 crYUSD tokens.

6. Attack contract

A(0x961d2b694d9097f35cfffa363ef98823928a330d) created an attack contract in the constructor

B(0xf701426b8126BC60530574CEcDCb365D47973284), after 5, attack contract B borrows 524,102.159298234706604104 WETH from AAVE

7.B sends 6000WETH to A

8. B converts the remaining WETH into ETH, and calls the crETH pool for mortgage.

9. Use attack contract B to lend

446,758,198.60513882090167283 YUSD tokens, mint crYUSD with this, return after minting, and send crYUSD to A, repeat twice.

10. Use attack contract B to lend

446,758,198.60513882090167283 YUSD, sent to A.

11. Use 1,873.933802532388653625 WETH to exchange 7,453,002.766252 USDC in uniswap v3.

12. Exchange 3,726,501.383126 USDC for DUSD in Curve.fi.

13. Exchange DUSD for

450,228,633.135400282653487952 yDAI+yUSDC+yUSDT+yTUSD。

14. Send 8,431,514.81679698041016119 yDAI+yUSDC+yUSDT+yTUSD directly back to the yUSD mortgage pool. Due to the use of direct transfer, the totalDebt remains unchanged, and the balanceOf (self) becomes larger, resulting in a larger totalAsset, which ultimately affects the price of the oracle oracle machine.

15. With yUSD tokens as collateral, lend all tokens that support lending in the cream protocol.

secondary title

#3 Event review

What do we need to pay attention to Case Review

Notice

Notice

Previously, Cream Finance had been attacked by hackers at least four times, and this attack also made the project the DeFi project with the most successful attacks by hackers.

On February 13 this year, hackers used the Alpha Homora V2 technical vulnerability to lend ETH, DAI, USDC and other assets from Iron Bank, a zero-mortgage cross-protocol loan function under Cream Finance, resulting in a loss of about US$38 million for the project. Alpha Finance has since stated that it will pay the assets in full.

On the 28th of the same month, the DeFi aggregation platform Furucombo was attacked by a serious vulnerability, and the Cream Finance reserve account was affected. The Cream Finance team immediately revoked all approvals for external contracts, but still lost $1.1 million.

On March 15th, the domain name of Cream Finance was attacked by hackers. Some users will see the website initiate a request to enter the mnemonic phrase. Soon the project officially tweeted to remind users not to enter the mnemonic phrase, indicating that its smart contract and user funds are still Safe, and announced regaining domain ownership after 1 hour.

On August 30, Cream Finance suffered a flash loan attack due to a reentrant vulnerability. The hacker made a profit of 420 million AMP, 1308 ETH, and a small amount of USDC and other stable currency assets, with a total asset value of more than 34 million US dollars.

Coupled with this attack, Cream Finance can be said to be the most "declining" DeFi project of the year.

成都链安
作者文库