The Cetus protocol suffered a $230 million attack, with an overflow vulnerability leading to a massive theft of funds.

robot
Abstract generation in progress

Cetus protocol suffers $230 million attack, detailed explanation of attack methods and fund flow

On May 22, Cetus, a liquidity provider in the SUI ecosystem, was suspected of being attacked, resulting in significant drops in several trading pairs, with estimated losses exceeding $230 million. Cetus subsequently announced that it has suspended its smart contracts and is investigating the incident.

The Slow Fog Security Team quickly intervened for analysis and issued a security alert. Below is a detailed analysis of the attack methods and the status of fund transfers.

Attack Analysis

The attacker bypasses detection by carefully constructing parameters and exploiting overflow vulnerabilities, exchanging a minimal amount of tokens for a massive amount of liquidity assets. The specific steps are as follows:

  1. The attacker borrowed 10,024,321.28 haSUI through a flash loan, causing the pool price to plummet by 99.90%.

  2. The attacker chose a very narrow price range to open a liquidity position, with a range width of only 1.00496621%.

  3. Attack Core: The attacker claims to add huge liquidity, but the system only received 1 token A due to a vulnerability.

  4. The attacker removes liquidity and gains huge token rewards:

    • First removal: 10,024,321.28 haSUI
    • Second removal: 1 haSUI
    • Third removal: 10,024,321.28 haSUI
  5. The attacker returned the flash loan, netting approximately 10,024,321.28 haSUI and 5,765,124.79 SUI.

Slow Fog: Cetus was hacked for $230 million, analyzing the attack method and fund transfer situation

vulnerability reason

The key to a successful attack lies in the overflow detection bypass vulnerability in the checked_shlw function within get_delta_a. Any input less than a specific value will bypass the overflow detection, but after a left shift of 64 bits, the result exceeds the u256 range, causing the high-order data to be truncated, leading the system to underestimate the required amount of haSUI.

Slow Fog: Cetus hacked $230 million, analysis of attack methods and fund transfer situation

project party repair

Cetus has released a patch that mainly fixes the checked_shlw function:

  • Corrected the erroneous mask value
  • Adjusted the judgment criteria
  • Ensure that the overflow flag can be correctly detected and returned

Slow Fog: Cetus was hacked for $230 million, analyzing the attack method and fund transfer situation

Capital Flow Analysis

The attacker profited approximately $230 million, including various assets such as SUI, vSUI, and USDC. Some of the funds were transferred to EVM addresses through cross-chain bridges. The attacker also deposited about $10 million into Suilend and transferred 24,022,896 SUI to a new address.

Slow Fog: Cetus was hacked for $230 million, analyzing the attack method and fund transfer situation

According to Cetus, with the assistance of institutions such as the SUI Foundation, approximately $162 million of stolen funds on SUI has been successfully frozen.

The address receiving cross-chain funds on EVM received 5.2319 BNB on BSC and a large amount of USDT, USDC, SOL, and ETH on Ethereum. Most of these assets were exchanged for ETH, with 20,000 ETH being transferred to another address.

Slow Fog: Cetus hacked $230 million, analyzing the attack method and fund transfer situation

Slow Mist: Cetus was hacked for $230 million, analyzing the attack method and fund transfer situation

Slow Fog: Cetus was hacked for 230 million USD, analyzing the attack method and fund transfer situation

Slow Fog: Cetus was hacked for $230 million, analyzing the attack method and fund transfer situation

Slow Fog: Cetus was hacked for $230 million, analysis of attack methods and fund transfer situation

Slow Fog: Cetus was hacked for $230 million, analyzing the attack method and fund transfer situation

Slow Fog: Cetus was hacked for $230 million, analysis of attack methods and fund transfer situation

Slow fog: Cetus hacked 230 million USD, analysis of attack methods and fund transfer situation

Slow Mist: Cetus was hacked for $230 million, analyzing the attack methods and fund transfer situation

Slow Fog: Cetus stolen $230 million, analysis of attack methods and fund transfer situation

Slow Fog: Cetus was hacked for $230 million, analyzing the attack method and fund transfer situation

Slow Fog: Cetus was hacked for $230 million, analyzing attack methods and fund transfer situations

Slow Fog: Cetus was hacked for $230 million, analysis of attack methods and fund transfer situation

Slow Fog: Cetus was hacked for $230 million, analyzing the attack method and fund transfer situation

Slow Fog: Cetus was stolen 230 million USD, analysis of attack methods and fund transfer situation

Slow Mist: Cetus was hacked for $230 million, analyzing the attack method and fund transfer situation

Slow Mist: Cetus stolen $230 million, analyzing attack methods and fund transfer situation

summary

This attack demonstrates the dangers of mathematical overflow vulnerabilities. The attacker exploited the defect in the checked_shlw function through precise calculations to gain massive liquidity at a very low cost. Developers should rigorously validate the boundary conditions of all mathematical functions in smart contracts to prevent similar attacks.

CETUS-0.43%
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
  • 5
  • Repost
  • Share
Comment
0/400
GateUser-a180694bvip
· 08-08 10:08
Something big has happened with sui again.
View OriginalReply0
GamefiHarvestervip
· 08-07 02:32
It exploded again, Rug Pull Rug Pull.
View OriginalReply0
DataOnlookervip
· 08-06 07:59
It's rare to have such a big hole of 230 million dollars. Take a break in the front row.
View OriginalReply0
fren.ethvip
· 08-06 07:54
Don't ask anymore, the fund is all in Sui, it has gone bankrupt, gone bankrupt.
View OriginalReply0
DuckFluffvip
· 08-06 07:41
Another path to getting rich... but it needs to overflow.
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)