
Post-mortem: MOBOX Hack Analysis
TechFlow Selected TechFlow Selected

Post-mortem: MOBOX Hack Analysis
On March 14, 2024, MOBOX, a decentralized lending protocol on the Optimism chain, was attacked, resulting in a loss of approximately $750,000.
Author: Doris
Background
On March 14, 2024, according to an alert from SlowMist MistEye security monitoring system, MOBOX, a decentralized lending protocol on the Optimism chain, was attacked and suffered losses of approximately $750,000. The SlowMist security team has analyzed the incident and shared their findings as follows:

(https://twitter.com/SlowMist_Team/status/1768167772230713410)
Related Information
Attacker addresses:
0x4e2c6096985e0b2825d06c16f1c8cdc559c1d6f8
0x96f004c81d2c7b907f92c45922d38ab870a53945
Compromised contract address:
0xae7b6514af26bcb2332fea53b8dd57bc13a7838e
Attack transaction:
0x4ec3061724ca9f0b8d400866dd83b92647ad8c943a1c0ae9ae6c9bd1ef789417
Attack Core
The core of this attack lies in two main aspects. First, the attacker exploited a vulnerability in the contract's borrow() function, which triggers a reward distribution to the referrer address every time it is called. Since the reward amount is calculated based on the number of tokens transferred, the attacker could increase the next borrowing amount by transferring the earned referral rewards back into the targeted contract. Second, each call to the borrow() function burns a portion of MO tokens in the pool, continuously driving up the price of MO tokens. As a result, the attacker eventually profited by repeatedly borrowing while stacking referral rewards.
Transaction Analysis
We can observe that the entire attack process mainly involves repeatedly calling the vulnerable borrow() function, immediately followed by redeem() to withdraw funds, then transferring the tokens allocated to the referrer back to the attacker's contract.

By analyzing the borrow() function, we find that each call burns a portion of MO tokens in the pool.

However, the amount of borrowed USDT is calculated based on the price of MO tokens in the pool. Due to continuous burning, the price of MO tokens keeps increasing, eventually allowing the attacker to borrow large amounts of USDT using only a small quantity of MO tokens.

Moreover, each loan grants a dividend reward to a referrer address, and this reward is calculated based on the amount of MO tokens passed into the function.

Since the referrer address is also controlled by the attacker (0x96f004c81d2c7b907f92c45922d38ab870a53945), after completing the borrowing operation, the attacker can transfer these rewards back, thereby increasing both the next borrowing amount and the subsequent referral rewards.

Through these repeated operations, the attacker inflated the price of MO tokens and ultimately managed to borrow large amounts of USDT from the contract using only a minimal amount of MO tokens. The attacker then directly exchanged all the USDT out of the imbalanced pool and exited with profits.

Summary
The core of this attack involved the exploitation of the borrow() function, which burns part of the tokens in the pool. By repeatedly borrowing assets, inflating the token price, and receiving referral rewards, the attacker transferred the earned tokens back into the contract and reused them for further borrowing, thus continuously stacking rewards and manipulating prices. The SlowMist security team recommends that project teams implement lock-up periods in similar functional functions and consider multiple factors when designing lending pricing models to prevent such incidents from recurring.
Join TechFlow official community to stay tuned
Telegram:https://t.me/TechFlowDaily
X (Twitter):https://x.com/TechFlowPost
X (Twitter) EN:https://x.com/BlockFlow_News










