okx

Review|Analysis of MOBOX hacked

时间:2024-03-20|浏览:233

欧易

欧易(OKX)

用戶喜愛的交易所

币安

币安(Binance)

已有账号登陆后会弹出下载

By:Doris

background

On March 14, 2024, according to an early warning from the SlowMist MistEye security monitoring system, MOBOX, the decentralized lending protocol on the Optimism chain, was attacked, resulting in a loss of approximately US$750,000. The SlowMist security team analyzed the attack incident and shared the results as follows:

REVIEWANALYSISOFMOBOXHACKED(https://twitter.com/SlowMist_Team/status/1768167772230713410)

Attacker address:

0x4e2c6096985e0b2825d06c16f1c8cdc559c1d6f8

0x96f004c81d2c7b907f92c45922d38ab870a53945

Attacked contract address:

0xae7b6514af26bcb2332fea53b8dd57bc13a7838eAttack transaction:0x4ec3061724ca9f0b8d400866dd83b92647ad8c943a1c0ae9ae6c9bd1ef789417

Attack the core

There are two main core points of this attack. One is that the attacker exploits the borrow() function vulnerability in the contract. Each call to this function will trigger the reward distribution to the recommender's address. Since the reward calculation is based on the number of transferred tokens, the attacker can increase the amount of the next borrowing by transferring the reward to the referrer back to the attacked contract again. The second is that each time the borrow() function is called, a part of the MO tokens in the pool will be burned, so the price of MO tokens is continuously raised. In the end, the attacker can make profits by continuously borrowing and superimposing rewards.

transaction analysis

We can find that the entire attack process mainly calls the vulnerable borrow() function in a loop, and then immediately calls redeem() to redeem, and then transfer the tokens allocated to the recommender back to the attack contract.​

REVIEWANALYSISOFMOBOXHACKEDFollowing the analysis of the borrow() function, we can find that each time this function is called, part of the MO tokens in the pool will be burned.

REVIEWANALYSISOFMOBOXHACKEDHowever, the amount of USDT loaned out is calculated based on the price of MO tokens in the pool. Since the price of MO tokens continues to rise due to burning, eventually attackers can lend a large amount of MO tokens with a small amount. USDT token.

REVIEWANALYSISOFMOBOXHACKEDIn addition, each borrowing will reward a referrer address with dividends, and the function is calculated based on the amount of MO tokens passed in.

REVIEWANALYSISOFMOBOXHACKEDHowever, since the referrer address is also controlled by the attacker (0x96f004c81d2c7b907f92c45922d38ab870a53945), the attacker can transfer this part of the reward back after completing the loan operation to superimpose the next loan amount and dividend rewards.

REVIEWANALYSISOFMOBOXHACKEDAfter the above cyclic operation, the attacker increased the price of MO tokens. Finally, he could use a very small number of MO tokens to lend out a large amount of USDT in the contract, and directly exchange all USDT in the unbalanced pool. Come out and take profits.

REVIEWANALYSISOFMOBOXHACKEDSummarize

The core of this attack is that the attacker uses the borrow() function to burn part of the tokens in the pool, constantly borrowing assets, raising the price of tokens in the pool and obtaining referrer rewards, and then transfers the tokens back and borrows them again , thereby continuously stacking rewards and manipulating prices. The SlowMist security team recommends that project parties add lock-up time limits to similar functions and consider multiple factors when designing the price model of lending to avoid similar incidents from happening again.

热点:

« 上一条| 下一条 »
区块链交流群

相关资讯

数藏交流群
区块链币圈-全球区块链数字货币行情、比特币虚拟货币资讯,狗狗币以太坊环保币柚子币莱特币瑞波币等加密数字货币价格非交易行情查询,金色财经巴比特范非小号快讯平台。
趣开心资讯 Qukaixin.cn ©2020-2024版权所有 桂ICP备19010284号-1