#Gate 2025 Semi-Year Community Gala# voting is in progress! 🔥
Gate Square TOP 40 Creator Leaderboard is out
🙌 Vote to support your favorite creators: www.gate.com/activities/community-vote
Earn Votes by completing daily [Square] tasks. 30 delivered Votes = 1 lucky draw chance!
🎁 Win prizes like iPhone 16 Pro Max, Golden Bull Sculpture, Futures Voucher, and hot tokens.
The more you support, the higher your chances!
Vote to support creators now and win big!
https://www.gate.com/announcements/article/45974
SUI ecosystem withstands attack tests: analysis of security mechanisms and long-term rise potential
Firm Belief After the Security Crisis: Why SUI Still Holds Long-term Rise Potential?
TL;DR
The essence of this attack lies in the lack of boundary checks in the arithmetic functions of the Cetus protocol------logical vulnerabilities caused by overly broad masking and shift overflow, unrelated to the resource security model of the SUI chain or the Move language. The vulnerability can be fixed with "a single line boundary check" and does not affect the core security of the entire ecosystem.
Although SUI has a slight tendency towards centralization due to features like DPoS validator rounds and blacklist freezing, this was precisely useful during the CETUS incident response: validators quickly synchronized malicious addresses to the Deny List, refusing to package related transactions, resulting in the instant freezing of over $160 million in funds. This is essentially a form of active "on-chain Keynesianism," where effective macroeconomic regulation has a positive impact on the economic system.
Mathematics and Boundary Validation: Introduce upper and lower limit assertions for all critical arithmetic operations (such as shifts, multiplications, and divisions), and perform extreme value fuzzing and formal verification. In addition, auditing and monitoring need to be enhanced: beyond general code auditing, add a specialized mathematical auditing team and real-time on-chain transaction behavior detection to capture abnormal splits or large flash loans early.
In the Cetus incident, SUI efficiently collaborated with the project party, successfully freezing over 160 million dollars in funds, and promoted a 100% compensation plan, demonstrating strong on-chain resilience and ecological responsibility. The SUI Foundation also added 10 million dollars for auditing funds to strengthen the security line. In the future, further promotion of on-chain tracking systems, community co-built security tools, decentralized insurance, and other mechanisms can be implemented to improve the fund protection system.
SUI has rapidly transitioned from a "new chain" to a "strong ecosystem" in less than two years, building a diversified ecological landscape covering multiple tracks such as stablecoins, DEX, infrastructure, DePIN, and gaming. The total scale of stablecoins has exceeded 1 billion USD, providing a solid liquidity foundation for the DeFi module; TVL ranks 8th globally, with trading activity ranking 5th globally and 3rd among non-EVM networks (only behind Bitcoin and Solana), demonstrating strong user participation and asset accumulation capabilities.
1. A chain reaction triggered by a single attack
On May 22, 2025, the leading AMM protocol Cetus deployed on the SUI network suffered a hacker attack. The attacker exploited a logic vulnerability related to an "integer overflow issue" to launch a precise manipulation, resulting in losses exceeding 200 million dollars in assets. This incident is not only one of the largest security incidents in the DeFi sector so far this year but also the most destructive hacker attack since the launch of the SUI mainnet.
According to DefiLlama data, SUI's total TVL on the day of the attack plummeted by more than $330 million, with the locked amount of the Cetus protocol instantly evaporating by 84%, dropping to $38 million. As a result, several popular tokens on SUI (including Lofi, Sudeng, Squirtle, etc.) experienced a crash of 76% to 97% within just one hour, triggering widespread concern in the market regarding the security and ecological stability of SUI.
However, after this shock wave, the SUI ecosystem has demonstrated strong resilience and recovery capability. Although the Cetus incident caused fluctuations in confidence in the short term, on-chain funds and user activity have not experienced a sustained decline; instead, it has significantly increased the entire ecosystem's focus on security, infrastructure development, and project quality.
Klein Labs will analyze the reasons behind this attack incident, the consensus mechanism of SUI nodes, the security of the MOVE language, and the ecological development of SUI, to outline the current ecosystem of this public chain, which is still in its early development stage, and explore its future development potential.
2. Analysis of the Causes of the Cetus Incident Attack
2.1 Attack Implementation Process
According to the technical analysis of the Cetus attack event by the Slow Mist team, hackers successfully exploited a critical arithmetic overflow vulnerability in the protocol, using flash loans, precise price manipulation, and contract flaws to steal over $200 million in digital assets in a short period of time. The attack path can be roughly divided into the following three stages:
①Initiate a flash loan to manipulate prices
The hacker first utilized the maximum slippage to flash swap 10 billion haSUI through a flash loan, borrowing a large amount of funds to manipulate the price.
Flash loans allow users to borrow and repay funds in a single transaction, requiring only a fee, featuring high leverage, low risk, and low cost. Hackers exploited this mechanism to briefly lower market prices and precisely control them within a very narrow range.
The attacker then prepares to create a very narrow liquidity position, precisely setting the price range between the lowest quote of 300,000 and the highest price of 300,200, with a price width of only 1.00496621%.
By using the above method, the hacker successfully manipulated the haSUI price with a large enough amount of tokens and enormous liquidity. Subsequently, they targeted several tokens with no actual value for manipulation.
②Add liquidity
Attackers create narrow liquidity positions, claiming to add liquidity, but due to a vulnerability in the checked_shlw function, they ultimately only receive 1 token.
This is essentially due to two reasons:
The mask is set too wide: equivalent to a very large liquidity addition limit, rendering the validation of user inputs in the contract virtually meaningless. Hackers bypassed the overflow detection by setting abnormal parameters, constructing inputs that are always less than this limit.
Data overflow was truncated: When performing the shift operation n << 64 on the numeric value n, data truncation occurred because the shift exceeded the effective bit width of the uint256 data type (256 bits). The overflow portion was automatically discarded, leading to a calculation result that was far below expectations, causing the system to underestimate the number of haSUI tokens needed for the exchange. The final calculation result was approximately less than 1, but since it was rounded up, the final result equaled 1, meaning the hacker only needed to add 1 token to exchange for a large amount of liquidity.
③Withdraw liquidity
Repay the flash loan and retain massive profits. Ultimately withdraw token assets worth hundreds of millions of dollars from multiple liquidity pools.
The situation of fund loss is serious, the attack resulted in the following assets being stolen:
12.9 million SUI (approximately 54 million USD)
60 million USDC
4.9 million USD Haedal Staked SUI
19.5 million dollars TOILET
Other tokens such as HIPPO and LOFI have fallen by 75--80%, liquidity has dried up.
2.2 The causes and characteristics of this vulnerability
The recent vulnerability of Cetus has three characteristics:
The cost of fixing is extremely low: on one hand, the root cause of the Cetus incident is a flaw in the Cetus math library, and not an error in the protocol's pricing mechanism or underlying architecture. On the other hand, the vulnerability is limited to Cetus itself and has nothing to do with SUI's code. The root of the vulnerability lies in a boundary condition check, and it only requires modifying two lines of code to completely eliminate the risk; once the fix is completed, it can be immediately deployed to the mainnet to ensure that the subsequent contract logic is complete and to eliminate this vulnerability.
High concealment: The contract has been running smoothly with zero faults for two years since its launch. The Cetus Protocol has undergone multiple audits, but no vulnerabilities have been found. The main reason is that the Integer_Mate library used for mathematical calculations was not included in the audit scope.
Hackers use extreme values to precisely construct trading intervals, creating extremely rare scenarios of submitting high liquidity, which triggers abnormal logic, indicating that such issues are difficult to detect through ordinary testing. These problems often lie in the blind spots of people's vision, which is why they remain hidden for a long time before being discovered.
Move excels in resource safety and type checking compared to various smart contract languages, with built-in native detection for integer overflow issues in common scenarios. This overflow occurred because an incorrect value was first used for the upper limit check when calculating the required token amount for adding liquidity, and bitwise operations were used instead of conventional multiplication. However, if conventional addition, subtraction, multiplication, and division are used in Move, it will automatically check for overflow situations, thus avoiding this kind of high-bit truncation issue.
Similar vulnerabilities have also appeared in other languages (such as Solidity and Rust), and they are even more easily exploited due to the lack of integer overflow protection; before the version update of Solidity, the overflow checks were very weak. Historically, there have been addition overflow, subtraction overflow, multiplication overflow, etc., all directly caused by the operation results exceeding the range. For example, the vulnerabilities in the two smart contracts BEC and SMT in the Solidity language both bypassed the detection statements in the contracts through carefully constructed parameters, achieving attacks through excessive transfers.
3. The consensus mechanism of SUI
3.1 Introduction to SUI Consensus Mechanism
Overview:
SUI adopts a Delegated Proof of Stake framework (DeleGated Proof of Stake, referred to as DPoS)). Although the DPoS mechanism can increase transaction throughput, it cannot provide the extremely high level of decentralization like PoW (Proof of Work). Therefore, the level of decentralization of SUI is relatively low, and the governance threshold is relatively high, making it difficult for ordinary users to directly influence network governance.
Average number of validators: 106
Average Epoch Cycle: 24 hours
Mechanism process:
Equity Delegation: Ordinary users do not need to run nodes themselves; they can participate in network security assurance and reward distribution by staking SUI and delegating it to candidate validators. This mechanism lowers the participation threshold for ordinary users, allowing them to engage in network consensus by "hiring" trusted validators. This is also a significant advantage of DPoS compared to traditional PoS.
Representative round block: A small number of selected validators produce blocks in a fixed or random order, which improves confirmation speed and increases TPS.
Dynamic Election: After each voting period, a dynamic rotation occurs based on voting weight to re-elect the Validator set, ensuring node vitality, interest consistency, and decentralization.
Advantages of DPoS:
High efficiency: Due to the controllable number of block-producing nodes, the network can complete confirmations in milliseconds, meeting high TPS requirements.
Low cost: Fewer nodes participate in consensus, significantly reducing the network bandwidth and computing resources required for information synchronization and signature aggregation. As a result, hardware and operational costs decrease, the requirements for computing power are lowered, and costs are reduced. Ultimately, this achieves lower user transaction fees.
High security: The staking and delegation mechanisms amplify the cost and risk of attacks simultaneously; combined with the on-chain confiscation mechanism, it effectively suppresses malicious behavior.
At the same time, the consensus mechanism of SUI employs a BFT (Byzantine Fault Tolerance) based algorithm, requiring more than two-thirds of the votes among validators to reach a consensus in order to confirm transactions. This mechanism ensures that even if a minority of nodes act maliciously, the network can still maintain secure and efficient operation. Any upgrades or major decisions also require more than two-thirds of the votes to be implemented.
Essentially, DPoS is a type of the impossible triangle.