# What happened in the Cetus exploit?

URL: https://shield.quillaudits.com/exploits/cetus-2025/

On 22 May 2025, starting at about 10:30 UTC, an attacker took about $223M from Cetus, a decentralized exchange on Sui, by opening a huge liquidity position for about 1 unit of one token ([The Block](https://www.theblock.co/post/355795); [BlockSec](https://blocksec.com/blog/cetus-incident-one-unchecked-shift-drains-223m-largest)). The root cause was an overflow check in `checked_shlw`, a function in the open-source integer-mate math library, that compared against the wrong limit, so a left shift in the deposit math silently lost its top bits ([Cyfrin](https://www.cyfrin.io/blog/inside-the-223m-cetus-exploit-root-cause-and-impact-analysis)). Sui validators froze about $162M of it before it left Sui ([The Block](https://www.theblock.co/post/355795)). Cetus is written in Move, which QuillShield doesn't support today. For Move code, [request a manual audit from QuillAudits](https://www.quillaudits.com/smart-contract-audit).

Last updated 3 December 2026. 6 minute read. By the QuillAudits Team.

## What is the timeline of the Cetus exploit?

| Protocol | Cetus |
| --- | --- |
| Date | 22 May 2025 |
| Chain | Sui |
| Loss | about $223M (Cetus); about $260M (Cointelegraph) |
| What happened | checked_shlw in the integer-mate library was meant to flag any value that would overflow when shifted left by 64 bits, but its bound was far too high. The attacker opened a position with an enormous liquidity value over a narrow price range, the shifted value lost its top bits, and the pool asked for about 1 unit of token A. Removing that liquidity paid out real tokens. Sui validators froze about $162M, which was later moved to a recovery multisig. |
| Sources | [The Block](https://www.theblock.co/post/355795), [BlockSec](https://blocksec.com/blog/cetus-incident-one-unchecked-shift-drains-223m-largest), [Cyfrin](https://www.cyfrin.io/blog/inside-the-223m-cetus-exploit-root-cause-and-impact-analysis) |

1. 22 May 2025, 10:30:50 UTC: the attack starts ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)). Elliptic also puts the start at about 10:30 UTC ([Elliptic](https://www.elliptic.co/blog/cetus-protocol-hacked-for-more-than-200-million)).
2. 10:40 UTC: monitoring flags irregular activity in the pools ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)).
3. 10:53 UTC: Cetus finds the source of the attack and alerts the Sui ecosystem ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)).
4. 10:57:47 UTC: Cetus shuts its core CLMM pools ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)), within 30 minutes of the start ([The Block](https://www.theblock.co/post/355795)).
5. 11:20 UTC: all related smart contracts are disabled ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)).
6. 12:50 UTC: Sui validators start voting to ignore transactions from the attacker's addresses. Once more than 33% of stake agrees, those addresses are effectively frozen ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)).
7. 18:04 UTC: an on-chain message opens negotiation with the attacker ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)).
8. 18:15 UTC: the vulnerable contract is patched but not yet reactivated ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)).
9. By 27 May 2025: Cetus proposes an on-chain vote to recover the frozen $162M, offers the attacker a white-hat settlement and announces a $5M bounty for information that leads to the attacker's identification and arrest ([The Block](https://www.theblock.co/post/355795)).
10. 29 May 2025: Sui validators approve moving the frozen $162M to a multisig controlled by Cetus, OtterSec and the Sui Foundation, with 90.9% voting yes ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui); [Cyfrin](https://www.cyfrin.io/blog/inside-the-223m-cetus-exploit-root-cause-and-impact-analysis)).

## What was the overflow bug in checked_shlw?

Cetus runs concentrated liquidity (CLMM) pools: a liquidity provider picks a price range, and the pool works out how much of each token the position needs. Part of that math shifts a 256-bit value left by 64 bits with `checked_shlw` ([Cyfrin](https://www.cyfrin.io/blog/inside-the-223m-cetus-exploit-root-cause-and-impact-analysis)), which is meant to report an overflow for any value that would not fit after the shift. A value fits only if it is below 2^192. The check compared against `0xffffffffffffffff << 192` instead ([BlockSec](https://blocksec.com/blog/cetus-incident-one-unchecked-shift-drains-223m-largest)), which Cetus's report describes as checking against a 256-bit limit where a 192-bit one was needed ([The Block](https://www.theblock.co/post/355795)). Every value between the two passed, and the shift dropped its top bits.

**Vulnerable: checked_shlw in Move, simplified, not the original code (illustrative, not audited code)** `math_u256.move`

```
// Meant to return (n << 64, false), or (0, true) when the shift would overflow.
public fun checked_shlw(n: u256): (u256, bool) {
    let mask = 0xffffffffffffffff << 192;
    // Wrong bound: values from 2^192 up to this mask pass the check.
    if (n > mask) {
        (0, true)
    } else {
        // The shift drops the bits that no longer fit, with no error.
        ((n << 64), false)
    }
}
```

**Fixed: the bound Cyfrin describes, n >= 1 << 192, simplified (illustrative, not audited code)** `math_u256_fixed.move`

```
public fun checked_shlw(n: u256): (u256, bool) {
    // n << 64 fits in 256 bits only when n is below 2^192.
    if (n >= (1 << 192)) {
        (0, true)
    } else {
        ((n << 64), false)
    }
}
```

With that gap open, the attacker borrowed tokens with a flash swap and opened a position over a very narrow tick range, about 300000 to 300200, with a liquidity value of 10,365,647,984,364,446,732,462,244,378,333,008. The pool worked out the token A it needed as about 1 unit ([BlockSec](https://blocksec.com/blog/cetus-incident-one-unchecked-shift-drains-223m-largest)). The attacker then removed liquidity for real tokens, repaid the flash swap, kept the rest and repeated the steps across pools ([Cyfrin](https://www.cyfrin.io/blog/inside-the-223m-cetus-exploit-root-cause-and-impact-analysis)). The flawed check sat in an open-source library that Cetus's contract used, not in the pool logic itself ([The Block](https://www.theblock.co/post/355795)).

## Can the same bug happen in Solidity?

Yes. Solidity 0.8 reverts when `+`, `-` or `*` overflows, but it never checks a shift: bits that fall off the top are dropped, as in Move. In our test with solc 0.8.28, `(1 << 200) << 64` returns 0 without reverting. Any hand-written overflow guard around a shift, and any math in an `unchecked` block or in assembly, needs the same boundary test. Here is Cetus's check in Solidity, next to the correct one. The class is covered on [integer overflow and underflow](https://shield.quillaudits.com/learn/vulnerabilities/integer-overflow-underflow/).

**The same flawed check in Solidity, next to the correct one (illustrative, not audited code)** `ShiftMath.sol`

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

library ShiftMath {
    // Wrong: lets through values from 2**192 up to 2**256 - 2**192.
    function checkedShlwFlawed(uint256 n) internal pure returns (uint256, bool) {
        uint256 mask = uint256(0xffffffffffffffff) << 192;
        if (n > mask) return (0, true);
        return (n << 64, false); // Solidity does not check shifts: the top bits are dropped
    }

    // Right: n << 64 fits in 256 bits only when n < 2**192.
    function checkedShlw(uint256 n) internal pure returns (uint256, bool) {
        if (n >= 1 << 192) return (0, true);
        return (n << 64, false);
    }
}
```

## How much did Cetus lose?

About $223M by Cetus's count, as reported by The Block ([The Block](https://www.theblock.co/post/355795)), and BlockSec and Cyfrin use the same figure ([BlockSec](https://blocksec.com/blog/cetus-incident-one-unchecked-shift-drains-223m-largest); [Cyfrin](https://www.cyfrin.io/blog/inside-the-223m-cetus-exploit-root-cause-and-impact-analysis)). Cointelegraph puts it at about $260M ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)). Elliptic, which counts over $200M, explains the gap: some reports valued the tokens before the theft at more than $260M, but several of the stolen tokens fell in value afterwards ([Elliptic](https://www.elliptic.co/blog/cetus-protocol-hacked-for-more-than-200-million)).

About $162M stayed on Sui and was frozen. Roughly $60M had already been swapped to USDC, bridged to Ethereum and swapped for ETH ([The Block](https://www.theblock.co/post/355795)).

## How were the frozen funds recovered?

Sui validators ignored transactions from the attacker's addresses once more than 33% of stake had voted to, which kept about $162M on Sui ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui); [The Block](https://www.theblock.co/post/355795)). Cetus then asked validators to vote on moving those funds. On 29 May 2025 they approved it, 90.9% in favor, and the funds went to a multisig controlled by Cetus, OtterSec and the Sui Foundation ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)). Cyfrin reports that full recovery was backed by Cetus's treasury and by a Sui Foundation loan that covered the part that had already left Sui ([Cyfrin](https://www.cyfrin.io/blog/inside-the-223m-cetus-exploit-root-cause-and-impact-analysis)).

A freeze like this depends on a chain's validators acting together. It is not something a contract can plan on.

## What would a proof-of-concept-first audit test here?

Test the boundary, not the happy path. For a checked shift the property is short: when the function reports no overflow, shifting the result back must give the input again. A fuzzer finds a counterexample fast, because almost every 256-bit value is above 2^192, and a unit test pins the first value that does not fit.

**Boundary tests for a checked left shift, aimed at the flawed bound (illustrative, not audited code)** `CheckedShlwTest.sol`

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

/// Foundry-style tests. Both fail against the flawed bound and pass with n >= 1 << 192.
contract CheckedShlwTest {
    function checkedShlw(uint256 n) public pure returns (uint256, bool) {
        uint256 mask = uint256(0xffffffffffffffff) << 192; // the bound under test
        if (n > mask) return (0, true);
        return (n << 64, false);
    }

    // Property: if no overflow is reported, no bits were lost.
    function testFuzz_noSilentTruncation(uint256 n) public pure {
        (uint256 shifted, bool overflow) = checkedShlw(n);
        if (!overflow) require(shifted >> 64 == n, "bits were lost without an overflow flag");
    }

    // The first value that does not fit after the shift.
    function test_firstValueThatDoesNotFit() public pure {
        (, bool overflow) = checkedShlw(1 << 192);
        require(overflow, "2**192 shifted left by 64 does not fit in 256 bits");
    }
}
```

We ran both tests with Foundry and solc 0.8.28: against the flawed bound both fail, and with `n >= 1 << 192` both pass.

- Find every hand-written overflow check, every shift and every `unchecked` block, and fuzz each one at its boundary.
- Write the invariant the attack broke: with prices held fixed, removing a position never pays out more than it took to open it.
- Treat the libraries in scope like your own code. Here the flawed check sat in a shared math library.

QuillShield supports Solidity in Foundry projects today, not Move. On a Solidity codebase, a full audit reviews the arithmetic across the code in scope, a separate reviewer agent tries to disprove each finding, and on full audits each finding that holds up comes with a proof of concept. For Move code like Cetus's, [request a manual audit from QuillAudits](https://www.quillaudits.com/smart-contract-audit) or [talk to an auditor](https://calendly.com/akshadh-a-quillaudits/30min). Before any audit, the [audit readiness checklist](https://shield.quillaudits.com/tools/smart-contract-audit-readiness-checklist/) helps you list the boundaries worth testing.

## FAQ

### Does QuillShield audit Move code?

No. QuillShield supports Solidity in Foundry projects today. For Move, including code on Sui, [request a manual audit from QuillAudits](https://www.quillaudits.com/smart-contract-audit). The [Move page](https://shield.quillaudits.com/languages/move/) covers the language's bug classes.

### Was the bug in Cetus's own code?

It was in `checked_shlw`, part of integer-mate, an open-source math library that Cetus's contract used ([The Block](https://www.theblock.co/post/355795); [BlockSec](https://blocksec.com/blog/cetus-incident-one-unchecked-shift-drains-223m-largest)). Cetus patched the vulnerable contract the same day ([Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui)).

### Did Sui freeze the stolen funds?

Most of them. Validators ignored transactions from the attacker's addresses, which froze about $162M on Sui. About $60M had already been bridged to Ethereum ([The Block](https://www.theblock.co/post/355795)).

## Sources

- [Sui DEX Cetus says overlooked flaw in open-source library used by smart contract led to $223 million exploit, The Block](https://www.theblock.co/post/355795) · checked 3 December 2026
- [Cetus incident: one unchecked shift drains $223M, BlockSec](https://blocksec.com/blog/cetus-incident-one-unchecked-shift-drains-223m-largest) · checked 3 December 2026
- [Inside the $223M Cetus exploit: root cause and impact analysis, Cyfrin](https://www.cyfrin.io/blog/inside-the-223m-cetus-exploit-root-cause-and-impact-analysis) · checked 3 December 2026
- [When liquidity attracts attackers: what went wrong on Cetus?, Cointelegraph](https://cointelegraph.com/explained/how-220m-was-stolen-in-minutes-understanding-the-cetus-dex-exploit-on-sui) · checked 3 December 2026
- [Cetus Protocol hacked for more than $200 million, Elliptic](https://www.elliptic.co/blog/cetus-protocol-hacked-for-more-than-200-million) · checked 3 December 2026
