Background
On June 10, 2024, according to the MistEye security monitoring system, the UwU Lend platform, which provides digital asset lending services on the EVM chain, was attacked, resulting in a loss of approximately $19.3 million. The SlowMist security team conducted an analysis of the incident and shared the following results:
(https://x.com/SlowMist_Team/status/1800181916857155761)
Relevant Information
Attacker’s Address:
0x841ddf093f5188989fa1524e7b893de64b421f47
Vulnerable Contract Address:
0x9bc6333081266e55d88942e277fc809b485698b9
Attack Transactions:
0xca1bbf3b320662c89232006f1ec6624b56242850f07e0f1dadbe4f69ba0d6ac3
0xb3f067618ce54bc26a960b660cfc28f9ea0315e2e9a1a855ede1508eb4017376
0x242a0fb4fde9de0dc2fd42e8db743cbc197ffa2bf6a036ba0bba303df296408b
Core of the Attack
The core of this attack lies in the attacker’s ability to manipulate the price oracle directly by conducting large exchanges in the CurveFinance pool, influencing the price of the sUSDE token, and exploiting the manipulated price to drain other assets from the pool.
Attack Process
1. Borrow assets through flash loans and drive down the price of USDE: The attacker first borrowed a large amount of assets through flash loans and exchanged a portion of the borrowed USDE tokens for other tokens in the Curve pool that could affect the sUSDE price.
2. Create a large number of lending positions: With the sUSDE price plummeting, the attacker deposited other underlying tokens to borrow sUSDE tokens in large quantities.
3. Manipulate the oracle again to raise the price of sUSDE: By performing reverse exchanges in the previous Curve pool, the attacker quickly raised the price of sUSDE.
4. Liquidate a large number of debt positions: With the price of sUSDE rapidly increasing, the attacker was able to liquidate the borrowed positions in large quantities to obtain uWETH.
5. Deposit the remaining sUSDE and borrow other underlying tokens in the contract: The attacker deposited the currently high-priced sUSDE again to borrow more underlying asset tokens for profit.
It is evident that the attacker primarily manipulated the price of sUSDE repeatedly, borrowing heavily when the price was low, and liquidating and re-collateralizing when the price was high to profit. We further investigated the sUSDE price oracle contract, sUSDePriceProviderBUniCatch:
It can be seen that the price of sUSDE is determined by obtaining different prices of 11 USDE tokens from the CurveFinance USDE pool and UNI V3 pool, sorting and calculating the median based on these prices.
In the calculation logic here, 5 prices of USDE are directly obtained using the get_p function to get the immediate spot price of the Curve pool, which allowed the attacker to directly influence the median price calculation result through large exchanges in a single transaction.
MistTrack Analysis
According to the on-chain tracking tool MistTrack analysis, the attacker 0x841ddf093f5188989fa1524e7b893de64b421f47 profited approximately $19.3 million in this attack, including ETH, crvUSD, bLUSD, USDC, and subsequently exchanged ERC-20 tokens for ETH.
By tracing the transaction fees of the attacker’s address, it was found that the initial funds on this address came from 0.98 ETH transferred from Tornado Cash, followed by 5 transfers of funds from Tornado Cash to this address.
Further analysis of the transaction graph revealed that the attacker transferred 1,292.98 ETH to the address 0x48d7c1dd4214b41eda3301bca434348f8d1c5eb6, with the current balance at 1,282.98 ETH; the remaining 4,000 ETH was transferred to the address 0x050c7e9c62bf991841827f37745ddadb563feb70, with the current balance at 4,010 ETH.
MistTrack has blacklisted the relevant addresses and will continue to monitor the movement of stolen funds.
Conclusion
The core of this attack lies in the attacker’s exploitation of the price oracle’s vulnerability to manipulate the price of sUSDE, allowing for lending and liquidation to profit from unexpected spreads. The SlowMist security team recommends that projects enhance the resistance to price manipulation of oracles, design a more secure oracle price feeding mechanism, and prevent similar events from recurring.
Subscribe to Updates
Get the latest creative news from FooBar about art, design and business.