Skip to content
Smart contracts Write-up Advanced

Inside the $223M Cetus Exploit: A Shared Library Bug That Broke Sui’s Largest DEX

A faulty overflow check in a shared math library let an attacker deposit tiny amounts and receive huge liquidity credits in Cetus pools, then withdraw real reserves. The attacker drained about $223M in under 15 minutes, though validators later froze roughly $162M on Sui.

willworachat Follow

Published on medium.com

How an incorrect overflow check in a math library allowed an attacker to drain $223M in 15 minutes — with spoof tokens, rapid bridging, and on-chain validator intervention.

Willworachat, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

The attacker could drain about $223M across more than 200 positions, though validators froze roughly $162M on Sui and about $61M was bridged to Ethereum.

What the attacker needed

Access to Cetus pools on Sui; ability to open a narrow CLMM position; spoof tokens to manipulate price curves

The fix

The vulnerable library was upgraded with a corrected overflow check that rejects values with non-zero bits in the top 64 bits before shifting.

How it was found

  1. Open a very narrow concentrated liquidity position.
  2. Call add_liquidity, which triggers the buggy checked_shlw function.
  3. The token-delta calculation undercharges the required deposit.
  4. The pool credits a huge liquidity amount.
  5. Remove liquidity and withdraw real reserves.
  6. Repeat across multiple pools.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A math helper used by the exchange had a broken safety check. When numbers got too big, the check let them through instead of stopping the calculation, so the exchange credited far more pool shares than the attacker actually paid for. The attacker then withdrew real funds.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.