Toutes les vulnérabilités
CRITICALWeb3exploited in the wild

WEB3-CETUS-2025

Web3 · Sui · Cetus Protocol

Résumé

On May 22, 2025 Cetus Protocol, the leading DEX on Sui, was drained of approximately $223M. The root cause was a flawed overflow check: the checked_shlw function in the integer-mate math library built its guard mask as 0xFFFFFFFFFFFFFFFF << 192 instead of 0x1 << 192, so values above 2^192 slipped past the check and the subsequent 64-bit left shift silently overflowed (left shifts do not abort in Move). The flaw lived in get_delta_a, which computes the tokens needed for a liquidity position; under the overflow the numerator wrapped to a tiny value, so the function demanded as little as 1 token unit for an enormous liquidity amount. Using flash swaps (borrowing ~10M haSUI), the attacker opened a tight-range position (ticks [300000, 300200]) and minted a massive amount of liquidity for a negligible deposit, then withdrew real pool reserves. Around $162M was frozen on-chain by Sui validators and eventually returned, while roughly $62M was bridged out to Ethereum. Cetus relaunched after recovering and replenishing affected pool liquidity.

Comment l’éviter dans votre code

  • Use safe math with explicit overflow checks; compute guard masks correctly (0x1 << n, not all-ones << n).
  • Abort on shift/multiply overflow rather than allowing silent wraparound.
  • Add invariant tests that minted liquidity always requires proportionate token input.
  • Include numeric library code in audit scope, not just business logic.
  • Fuzz liquidity math at extreme tick and value boundaries.

Références

Vulnérabilités liées

Tout Web3 →