Cellframe Network suffered a flash loan attack resulting in a loss of $76,112 due to a liquidity migration vulnerability.

robot
Abstract generation in progress

Analysis of the Flash Loan Attack Incident on Cellframe Network

On June 1, 2023, at 10:07:55 AM (UTC+8), Cellframe Network was attacked by hackers on a certain smart chain due to a token quantity calculation issue during the liquidity migration process. The attack resulted in the hackers profiting $76,112.

Web3 Security | Cellframe Network Analysis of Attack Incident Due to Flash Loans Manipulating Pool Ratios

Attack Details

Hackers use the Flash Loans feature to obtain large amounts of funds and tokens by manipulating the token ratios in the liquidity pool to carry out attacks. The attack process mainly includes the following steps:

  1. Acquire funds: Obtain 1000 native tokens of a certain chain and 500,000 New Cell tokens through Flash Loans.

  2. Manipulating the liquidity pool: Exchange all New Cell tokens for native tokens, causing the amount of native tokens in the pool to approach zero. Then exchange 900 native tokens for Old Cell tokens.

  3. Add liquidity: Before the attack, the hacker adds liquidity to the Old Cell and the native token's liquidity pool to obtain Old lp.

  4. Trigger liquidity migration: Call the liquidity migration function. At this point, the new pool has almost no native tokens, and the old pool has almost no Old Cell tokens.

  5. Exploiting computational vulnerabilities: Due to the very small quantity of Old Cell tokens in the old pool, the amount of native tokens obtained when removing liquidity increases, while the quantity of Old Cell tokens decreases. This causes users to only need to add a small amount of native tokens and New Cell tokens to acquire liquidity, and any excess tokens are returned to the user.

  6. Completing the attack: The hacker removes the liquidity from the new pool and exchanges the returned Old Cell tokens for native tokens. Then, by taking advantage of the situation where there are a large number of Old Cell tokens in the old pool but a lack of native tokens, they re-exchange the Old Cell tokens for native tokens, thus realizing a profit.

Web3 Security | Cellframe Network Analyzes Attack Incident Caused by Flash Loans Manipulating Pool Ratio

Web3 Security | Cellframe Network Analysis of Attack Incident Due to Flash Loans Manipulating Pool Ratios

Web3 Security | Analysis of the Attack Incident on Cellframe Network Due to Flash Loans Manipulating Pool Ratios

Web3 Security | Cellframe Network Analysis of Attack Incident Due to Flash Loans Manipulating Pool Ratios

Causes of Vulnerabilities and Prevention Suggestions

The root cause of this attack lies in the calculation issues during the liquidity migration process. The attacker exploited the calculation vulnerabilities in the migration function by manipulating the token ratio in the pool.

To prevent similar attacks, it is recommended to take the following measures:

  1. Comprehensive consideration: When migrating liquidity, one should fully consider the changes in the quantities of the two tokens in the old and new pools, as well as the current token prices.

  2. Avoid simple calculations: One should not rely solely on the quantities of the two currencies in the trading pair for direct calculations, as this can be easily manipulated by attackers.

  3. Security Audit: Before the code goes live, it is essential to conduct a comprehensive and rigorous security audit to identify and fix potential vulnerabilities.

This incident once again emphasizes the importance of security and robustness when designing and implementing complex financial operations. Project teams should remain vigilant at all times and continuously optimize their security measures.

Web3 Security | Cellframe Network Attacked Due to Flash Loan Manipulation of Pool Ratios

CELL2.59%
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 7
  • Repost
  • Share
Comment
0/400
DataBartendervip
· 07-15 16:49
The traps are new and lively~ The little black ones have something.
View OriginalReply0
BridgeTrustFundvip
· 07-14 05:30
Not much money, but it's like picking up money, right?
View OriginalReply0
MeaninglessApevip
· 07-13 09:59
Another Flash Loans~ Small loss
View OriginalReply0
SmartContractPlumbervip
· 07-13 09:56
Another live case that went online without auditing.
View OriginalReply0
GasWastingMaximalistvip
· 07-13 09:52
The theft is quite low.
View OriginalReply0
FarmToRichesvip
· 07-13 09:45
It's a good time to sell kidneys again.
View OriginalReply0
ApeWithNoChainvip
· 07-13 09:37
Played people for suckers again, really a noob.
View OriginalReply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)