Resilience after the SUI ecological security crisis: Looking beyond the Cetus incident for long-term rise potential

Strong Faith After the Security Crisis: Why SUI Still Has Long-Term Rise Potential?

1. A chain reaction triggered by an attack

On May 22, 2023, the leading AMM protocol Cetus deployed on the SUI network suffered a hacking attack. The attacker exploited a logical vulnerability related to the "integer overflow issue" to carry out precise manipulation, resulting in a loss of over $200 million in assets. This incident is not only one of the largest security incidents in the DeFi space so far this year but also the most destructive hacking attack since the launch of the SUI mainnet.

According to DefiLlama data, the total value locked (TVL) of the SUI chain plummeted by over $330 million on the day of the attack, with the locked amount of the Cetus protocol evaporating by 84% in an instant, dropping to $38 million. As a result, several popular tokens on SUI (including Lofi, Sudeng, Squirtle, etc.) plunged by 76% to 97% within just one hour, raising widespread concerns in the market about the security and ecological stability of SUI.

However, after this shock wave, the SUI ecosystem has shown strong resilience and recovery ability. Although the Cetus incident caused fluctuations in confidence in the short term, on-chain funds and user activity have not experienced a sustained decline; rather, it has significantly increased the entire ecosystem's attention to security, infrastructure development, and project quality.

We will analyze the reasons behind this attack incident, the node consensus mechanism of SUI, the security of the MOVE language, and the ecological development of SUI, outlining the current ecological landscape of this public chain, which is still in its early stages of development, and discussing its potential for future growth.

Strong Belief After the Security Crisis: Why SUI Still Has Long-term Rise 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 incident by the security team, the hacker 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

Hackers first exploited the maximum slippage to exchange 10 billion haSUI in a flash loan, borrowing a large amount of funds to manipulate prices.

Flash loans allow users to borrow and repay funds within the same transaction, only requiring a fee, featuring high leverage, low risk, and low cost. Hackers exploited this mechanism to quickly drive down market prices and precisely control them within a very narrow range.

The attacker then prepares to create an extremely 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 the above method, the hacker successfully manipulated the haSUI price using a sufficient amount of tokens and huge 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:

  1. The mask is set too wide: equivalent to a very large liquidity addition limit, rendering the verification of user inputs in the contract ineffective. Hackers bypassed the overflow detection by setting abnormal parameters that always construct inputs less than this limit.

  2. Data overflow was truncated: When performing a shift operation n << 64 on the numerical value n, data truncation occurred due to the shift exceeding the effective bit width of the uint256 data type (256 bits). The overflow portion in the high bits was automatically discarded, resulting in the computed value being far lower than expected, leading the system to underestimate the amount of haSUI needed for the exchange. The final computed result was approximately less than 1, but due to rounding up, it ended up being equal to 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 huge profits. Ultimately withdraw token assets worth hundreds of millions from multiple liquidity pools.

The situation of fund losses is serious, and the attack has 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%, leading to liquidity drying up.

Steadfast Belief After the Security Crisis: Why SUI Still Holds Long-Term Rise Potential?

2.2 The causes and characteristics of this vulnerability

This vulnerability of Cetus has three characteristics:

  1. The cost of fixing is extremely low: on one hand, the root cause of the Cetus incident is a flaw in the Cetus mathematical library, rather than an error in the protocol's pricing mechanism or underlying architecture. On the other hand, the vulnerability is limited to Cetus itself and is unrelated to SUI's code. The root of the vulnerability lies in a boundary condition check, and only two lines of code need to be modified to completely eliminate the risk; once the fix is completed, it can be deployed to the mainnet immediately to ensure the subsequent contract logic is complete and eliminate this vulnerability.

  2. High concealment: The contract has been running smoothly without any failures for two years since its launch. The Cetus Protocol has undergone multiple audits, but no vulnerabilities were found, mainly because the Integer_Mate library used for mathematical calculations was not included in the scope of the audit.

Hackers use extreme values to precisely construct trading intervals, creating extremely rare scenarios with high liquidity submissions, which trigger abnormal logic, indicating that such issues are difficult to detect through ordinary testing. These problems often lie in blind spots of people's vision, which is why they remain hidden for a long time before being discovered.

  1. Not a problem unique to Move:

Move excels in resource safety and type checking compared to various smart contract languages, and it has built-in native detection for integer overflow issues in common scenarios. This overflow occurred because an incorrect value was used for the upper limit check when calculating the required amount of tokens while adding liquidity, and bitwise operations were used instead of conventional multiplication. If conventional addition, subtraction, multiplication, and division were used in Move, it would automatically check for overflow situations, preventing such high-bit truncation issues.

Similar vulnerabilities have also appeared in other languages (such as Solidity, Rust), and they can be more easily exploited due to the lack of integer overflow protection; prior to the updates in Solidity, the checks for overflow were very weak. Historically, there have been addition overflows, subtraction overflows, multiplication overflows, etc., all directly caused by the operation results exceeding the range. For instance, vulnerabilities on the BEC and SMT smart contracts in Solidity were exploited by carefully crafted parameters that bypassed the detection statements in the contracts, enabling excessive transfers to implement attacks.

Steadfast Belief After a Security Crisis: Why SUI Still Has Long-Term rise Potential?

3. SUI's consensus mechanism

3.1 Introduction to SUI Consensus Mechanism

Overview:

SUI adopts a Delegated Proof of Stake framework (DeleGated Proof of Stake, abbreviated as DPoS)). Although the DPoS mechanism can increase transaction throughput, it cannot provide the same level of decentralization as PoW (Proof of Work). Therefore, SUI's degree of decentralization is relatively low, with higher governance thresholds, making it difficult for ordinary users to directly influence network governance.

  • Average number of validators: 106

  • Average Epoch Cycle: 24 hours

Mechanism Process:

  • Delegated Stake: 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 of block production: A few selected validators produce blocks in a fixed or random order, enhancing confirmation speed and increasing TPS.

  • Dynamic Election: After each voting period, a dynamic rotation is conducted 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 the 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 demand for computing power decreases, and costs are lower. Ultimately achieving lower user transaction fees.

  • High security: The staking and delegation mechanism amplifies the cost and risk of attacks; combined with the on-chain confiscation mechanism, it effectively suppresses malicious behavior.

At the same time, in the consensus mechanism of SUI, an algorithm based on BFT (Byzantine Fault Tolerance) is employed, requiring more than two-thirds of the votes from validators to reach a consensus in order to confirm a transaction. This mechanism ensures that even if a minority of nodes act maliciously, the network can still maintain safe and efficient operation. Any upgrades or major decisions also require more than two-thirds of the votes to be implemented.

Essentially, DPoS is a compromise solution to the "impossible triangle," balancing decentralization and efficiency. In the security-decentralization-scalability "impossible triangle," DPoS chooses to reduce the number of active block-producing nodes in exchange for higher performance, sacrificing a certain degree of complete decentralization compared to pure PoS or PoW, but significantly improving network throughput and transaction speed.

Steadfast Faith After the Security Crisis: Why SUI Still Has Long-Term Rise Potential?

3.2 The performance of SUI in this attack

3.2.1 Operation of the Freezing Mechanism

In this incident, SUI quickly froze the addresses related to the attacker.

From a code perspective, it prevents transfer transactions from being packaged on-chain. Validator nodes are core components of the SUI blockchain, responsible for validating transactions and executing protocol rules. By collectively ignoring transactions related to the attacker, these validators effectively implement a mechanism similar to the 'account freeze' in traditional finance at the consensus level.

SUI itself has a built-in deny list mechanism, which is a blacklist feature that can prevent any transactions involving listed addresses. Since this feature is already present in the client, when an attack occurs,

SUI can immediately freeze the hacker's address. Without this feature, even if SUI only has 113 validators, it would be difficult for Cetus to coordinate all validators to respond one by one in a short time.

3.2.2 Who has the authority to change the blacklist?

TransactionDenyConfig is a YAML/TOML configuration file that is locally loaded by each validator. Anyone running a node can edit this file, hot reload it, or restart the node, and update the list. On the surface, it seems that each validator is freely expressing their own values.

In fact, in order to ensure consistency and effectiveness of security policies, updates to this critical configuration are usually coordinated. Since this is an "emergency update driven by the SUI team", it is essentially the SUI Foundation (or its authorized developers) that sets and updates this deny list.

SUI has released a blacklist, which theoretically allows validators to choose whether to adopt it - but in practice, most people will automatically adopt it by default. Therefore, while this feature protects user funds, it does indeed have a certain degree of centralization.

3.2.3 The essence of the blacklist function

The blacklist function is not actually a logic at the protocol level; it is more like an additional layer of security to respond to emergencies and ensure the safety of user funds.

It is essentially a security assurance mechanism. Similar to a "security chain" tied to the door, it is only activated for those who want to intrude into the home, that is, for those who wish to maliciously act against the protocol. For users:

  • For large holders, the main providers of liquidity, the protocol aims to ensure the safety of funds, because in reality, the on-chain data TVL is all contributed by major holders. To ensure the long-term development of the protocol, safety will undoubtedly be prioritized.

  • For retail investors, contributors to ecological activity, and strong supporters of technology and community co-construction. Project

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 7
  • Share
Comment
0/400
GasGuruvip
· 2m ago
Pig-butchering scams are confirmed.
View OriginalReply0
GhostInTheChainvip
· 07-07 02:54
Hacker is too ruthless, the crypto world still needs to be played cautiously.
View OriginalReply0
MevHuntervip
· 07-07 02:54
It's still more fun to buy the dip in a Bear Market.
View OriginalReply0
FlashLoanKingvip
· 07-07 02:36
Crits are crits, buy the dip and get hyped!
View OriginalReply0
GweiTooHighvip
· 07-07 02:35
Who is responsible for this broken loophole?
View OriginalReply0
MEVHuntervip
· 07-07 02:29
The overflow vulnerability p2=p1 can still be exploited. Garbage code all over the place. Arbitrageurs are ecstatic.
View OriginalReply0
MaticHoleFillervip
· 07-07 02:25
play people for suckers and then Rug Pull. Where is the next victim?
View OriginalReply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)