Haotian | CryptoInsight
Haotian | CryptoInsight|May 22, 2025 15:06
Popular version: A simple "translation" interpretation of the technical expert's analysis of the @ CetusProtocol hacking incident: This attack exposed a classic integer overflow problem, specifically manifested as data truncation during type conversion. Technical Detail Disassembly: 1) Vulnerability location: The issue lies in the type conversion mechanism of the get1-amount y_liquidity function, where the forced conversion from u256 to u64 results in the loss of high-level data. 2) Attack process: 1. The attacker passes in a parameter with a very large amount of liquidity through the add_iquidity function; 2. The system calls the get.delta_b function to calculate the required number of B tokens; 3. In the calculation process, if two u128 type data are multiplied, the theoretical result should be u256 type; Key flaw: Forcefully converting the u256 result to u64 when the function returns, resulting in the truncation of high-order 128 bit data. 3) Utilization effect: The liquidity limit that originally required a large amount of tokens to be minted can now be completed with only a very small amount of tokens. The attacker obtained a huge share of liquidity at a very low cost, and then realized fund pool arbitrage by destroying some of the liquidity. Simple analogy: It's like using a calculator that can only display 8 digits to calculate 1 billion x 1 billion. The 20 digit calculation result can only display the last 8 digits, and the first 12 digits disappear directly. The attacker took advantage of this' loss of computational accuracy 'vulnerability. One thing needs to be clarified: this vulnerability is not related to the underlying security architecture of @ SuiNetwork, and belongs to the security "glory" of the Move language, which is currently credible. Why? The Move language does have significant advantages in resource management and type security, effectively preventing underlying security issues such as double payments and resource leaks. But the issue with the Cetus protocol this time is a mathematical calculation error at the application logic level, not a design flaw in the Move language itself. Specifically, although the type system of Move is strict, it still relies on the developer's correct judgment for explicit casting operations. When the program actively performs type conversion from u256 to u64, the compiler cannot determine whether this is intentional design or logical error. In addition, this security incident is completely unrelated to Sui's core underlying functions such as consensus mechanism, transaction processing, and state management. Sui Network only faithfully executed the transaction instructions submitted by the Cetus protocol, and the vulnerability stems from a logical flaw in the application layer protocol itself. Simply put, even the most advanced programming languages cannot completely eliminate logical errors at the application layer. Move can prevent most underlying security risks, but it cannot replace developers in performing boundary checks for business logic and overflow protection for mathematical operations.
Share To

HotFlash

APP

X

Telegram

Facebook

Reddit

CopyLink

Hot Reads