Cellframe Network was attacked by a flash loan attack, and the hacker made a profit of $76,000.

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 the smart chain due to a token quantity calculation issue during the liquidity migration process. This attack resulted in hackers profiting approximately $76,112.

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

Attack Process Analysis

The attacker carried out the attack through the following steps:

  1. Use Flash Loans to acquire 1000 BNB and 500,000 New Cell tokens.
  2. Exchange all New Cell tokens for BNB, causing the amount of BNB in the pool to approach zero.
  3. Exchange 900 BNB for Old Cell tokens.
  4. Before the attack, the attacker added liquidity of Old Cell and BNB, obtaining Old lp.
  5. Call the liquidity migration function. At this point, there is almost no BNB in the new pool, and there are almost no Old Cell tokens in the old pool.

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

The migration process includes:

  • Remove old liquidity and return the corresponding tokens to users.
  • Add new liquidity according to the new pool ratio.

Due to the scarcity of Old Cell tokens in the old pool, the amount of BNB obtained when removing liquidity increases while the Old Cell decreases. This results in users only needing a small amount of BNB and New Cell to acquire liquidity, while the excess BNB and Old Cell will be returned to the users.

Web3 Security | Cellframe Network Attacked Due to Flash Loans Manipulating Pool Ratios Analysis

  1. The attacker removes the liquidity from the new pool and exchanges the returned Old Cell for BNB.
  2. Repeat the migration operation to achieve profits.

Web3 Security | Cellframe Network Attacked Due to Flash Loans Manipulating Pool Ratios Analysis

Vulnerability Causes and Prevention Suggestions

The fundamental reason for the success of the attack is the calculation problem during the liquidity migration process. To prevent similar attacks, it is recommended:

  1. When migrating liquidity, one should fully consider the changes in the quantity of both old and new pool tokens as well as the current price.
  2. Avoid relying solely on the quantity of the two tokens in the trading pair for calculations, as this can be easily manipulated.
  3. Conduct a comprehensive security audit before the code goes live to identify and fix potential vulnerabilities.

Web3 Security | Cellframe Network Analyzes Attack Incident Due to Flash Loan Manipulation of Pool Ratio

This event once again emphasizes the importance of code security and comprehensive risk assessment in the field of decentralized finance. Project teams should always remain vigilant and continuously improve security measures to protect user assets and maintain the stability of the ecosystem.

Web3 Security | Cellframe Network Analysis of Attack Incident Caused by Flash Loans Manipulating Pool Ratios

CELL-6.71%
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
  • 6
  • Repost
  • Share
Comment
0/400
HasCooledDownvip
· 08-16 06:10
Fool, the news is still being sent in 2023.
View OriginalReply0
AirdropGrandpavip
· 08-16 05:30
Tsk tsk, Flash Loans are in trouble again.
View OriginalReply0
BridgeTrustFundvip
· 08-16 05:30
Have you been clipped coupons again?
View OriginalReply0
WagmiWarriorvip
· 08-16 05:13
Not much money was made this time.
View OriginalReply0
NFTRegretfulvip
· 08-16 05:11
This money was made playing with Flash Loans, and my hands are quite stable.
View OriginalReply0
OnchainFortuneTellervip
· 08-16 05:09
Sheer fabric sheer fabric This hacker work is too amateur.
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)