Attackers exploited a critical overflow flaw in Cetus Protocolâs automated market maker logic, which led to $223 million in user losses, according to a post-mortem by Dedaub.
âThis incident represents one of the most significant DeFi exploits in recent history, caused by a subtle but critical flaw in âoverflowâ protection,â blockchain security firm Dedaub said in its report.
Dedaub explained that the flaw involved an âoverflowâ in the math used by Cetusâs automated market maker, where a miswritten condition failed to properly handle the most significant bits of large numerical inputs and âdidnât produce the intended result.â
Instead of rejecting oversized values, the system truncated them, causing the output to appear much smaller than it should have.
This allowed the attacker to deposit just a single token while the protocol mistakenly credited them with an enormous liquidity position. They then used that position to withdraw large amounts of real assets from the pools.
According to Dedaub, a similar vulnerability had been flagged in early 2023 by blockchain security firm Ottersec during an audit of the protocolâs codebase when it was deployed on Aptos.
However, after the code was later ported to the Sui network, the underlying issue still remained. Although developers attempted to implement safeguards, the overflow check was flawed, allowing the same type of exploit to slip through unnoticed.
âThis incident shows why edge cases in DeFi canât be ignored,â Dedaub warned, adding that complex math in decentralized finance needs careful review and testing. It urged developers to verify overflow protection manually, especially when using large numbers or advanced math.
Cetus, a leading DEX on the SUI network, was hacked in the early hours of May 22, triggering one of the largest losses in the Sui ecosystem to date. Initial investigations claimed the incident stemmed from an âoracle bug.â.
The exploit led to over $223 million in losses across various liquidity pools, sparking a broad sell-off in related tokens, including SUI and CETUS, which dropped over 40% in the hours after the breach. Memecoins and smaller market cap tokens native to the network saw even steeper losses, with some plunging by over 90%.
In response, the Sui Foundation coordinated with validators to freeze around $163 million of the stolen funds. Cetus has also announced a $5 million bounty for information that identifies those responsible.