![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
Recently, an on-chain attack was detected against CloberDEX, a project on Base. The attacker gained about 133 ETH, or about 500,000 USD, through this attack.
The attacked project is CloberDEX, and its main functions are as follows: open a new trading pool containing trading pairs A to B and B to A, and each trading pair also contains a preset trading strategy; mint is to add liquidity to the trading pair and obtain LP Token; burn is to destroy LP Token to obtain the corresponding currency.
Let's take a look at the attack process:
First, the attacker borrowed 267 WETH from Morpho Blue using flashloan.
Then, the attacker used open to open two trading pairs on CloberDEX, namely Token/WETH and WETH/Token, where Token is a contract deployed by the attacker himself.
Then, the attacker used mint to transfer 267 WETH and 267 Token to the newly opened trading pair to add liquidity and obtain LP Token.
So far, there is no problem. Finally, the attacker uses burn to destroy the LP Token just obtained. Let's take a look at the specific implementation of burn;
The control flow goes to the lock function. Similarly, let's take a look at the specific implementation of lock;
As you can see, the lock function passes bytes caldata data to the lockAcquired function. Let's continue to look at the implementation of this function.
We found this line of code
We can see that the function called by the code is determined by data. The first four bytes of data are the signature of _burn, so burn essentially calls _burn.
We can see that _burn calls pool.strategy.burnHook(msg.sender, key, burnAmount,supply) again, and the processing of the pool's reserver comes after this code. So, the problem lies here. The address of the strategy contract of the pool corresponding to the trading pair can be controlled by the attacker. In this attack, the attacker wrote the address as his own attack contract address: 0x32fb1bedd95bf78ca2c6943ae5aeaeaafc0d97c1 .
When the contract process reaches the BurnHook of the attacking contract, burn is called again to complete the reentrancy attack.
The attacker took out 264 WETH and 133 WETH from the CloberDEX contract through this vulnerability, and made a profit of 133.7 ETH after repaying the flashloan loan, which is about 500,000 USD.
The main cause of this vulnerability is that the CloberDEX project contract did not perform reentrancy detection and protection in the code for obtaining and destroying LP Tokens, and the state variables were updated after the contract was called, which eventually led to the attacker using the reentry vulnerability to empty the project's WETH. It is recommended that the project party should conduct multi-party verification when designing the economic model, price calculation mechanism and code operation logic, and try to select multiple audit companies for cross-audit when auditing the contract before it goes online.
免責聲明:info@kdj.com
所提供的資訊並非交易建議。 kDJ.com對任何基於本文提供的資訊進行的投資不承擔任何責任。加密貨幣波動性較大,建議您充分研究後謹慎投資!
如果您認為本網站使用的內容侵犯了您的版權,請立即聯絡我們(info@kdj.com),我們將及時刪除。
-
- 獎金投資:從$ 1K到$ 96K的收益和下一個大模因硬幣的狩獵
- 2025-09-28 16:00:08
- 探索邦克的迅速崛起,並使用新的模因硬幣獲得類似收益的潛力。深入了解模因硬幣投資和未來機會的世界。
-
- PI Wallet:PI網絡中的精英和GCV穩定性守護者
- 2025-09-28 15:47:48
- 探索PI錢包如何確保價值,執行富有行權權並保護PI網絡不斷發展的數字經濟中的全球共識價值(GCV)。
-
- 鯨魚運動,XPL令牌和超流動性:解碼加密潮汐
- 2025-09-28 13:49:57
- 分析涉及XPL令牌的鯨魚活動及其對加密市場的影響。
-
-
-
-
-
- BTC,Hodlers和潛在的公牛奔跑:紐約人的看法
- 2025-09-28 13:26:39
- 分析比特幣的市場趨勢,霍德勒的行為以及牛市的潛力。市場是捲土重來的,還是不確定性的遊戲名稱?
-
- 比特幣,硬幣,立即購買:在2025年導航加密貨幣景觀
- 2025-09-28 13:26:36
- 想要購買比特幣或其他有前途的硬幣?探索加密市場的最新趨勢,從模因硬幣到面向企業的連鎖店,並發現潛在的投資機會。