Move language reference security module discovered a new integer overflow vulnerability

robot
Abstract generation in progress

A new integer overflow vulnerability has been discovered in the Move language reference security module.

Recently, during an in-depth study of the Move language, a new integer overflow vulnerability was discovered. This vulnerability exists within the reference safety verification module, and its triggering process is quite interesting. This article will provide an in-depth analysis of this vulnerability, as well as introduce relevant background knowledge of the Move language.

Numen Cyber exclusively discovered another high-risk vulnerability in the move language

The Move language will validate the code units before executing the bytecode, and the entire validation process is divided into 4 steps. The vulnerability discovered this time occurs in the reference_safety step.

The reference safety verification module is mainly responsible for checking whether there are dangling references, whether mutable reference access is safe, and whether global storage reference access is safe, etc. The verification process starts from the analyze_function function, verifying each basic block.

In the Move language, a basic block refers to a sequence of code that has no branching instructions other than the entry and exit. The system determines the basic blocks by traversing the bytecode and looking for all branching instructions and loop instruction sequences.

Numen Cyber exclusive discovery of another high-risk vulnerability in move language

The Move language supports two types of references: immutable reference (&) and mutable reference (&mut). The reference safety module scans the bytecode instructions of each basic block in the function to determine whether all reference operations are legal. The verification process uses the AbstractState structure, which contains two components: borrow graph and locals, to ensure the safety of references within the function.

Numen Cyber exclusively discovers another critical vulnerability in the move language

During the verification process, the system will execute the basic block code to generate the post state, and then merge the pre state and post state to update the block state. If the state changes and a loop exists, the basic block will be executed repeatedly until the post state equals the pre state or an error occurs.

Numen Cyber exclusively discovers another high-risk vulnerability in the move language

The vulnerability occurs in the join_ function. When the combined length of the parameters and local variables exceeds 256, using the u8 type to iterate locals can lead to integer overflow. Although the Move language has a process to verify the number of locals, it only checks the number of local variables and does not include the length of the parameters.

Numen Cyber exclusively discovered another high-risk vulnerability in move language

This integer overflow may lead to a denial of service attack. An attacker can construct a loop code block that exploits the overflow to change the block's state. When the execute_block function is executed again, if the index that the instruction needs to access does not exist in the new AbstractState locals map, it will cause the system to crash.

Numen Cyber exclusively discovered another high-risk vulnerability in the move language

To demonstrate this vulnerability, we can construct a basic block that contains unconditional branch instructions. By setting appropriate parameters and the number of local variables, we can overflow the locals map length to 8. On the second execution, attempting to access a non-existent offset will cause a panic.

Numen Cyber exclusive discovery of another high-risk vulnerability in the move language

Numen Cyber exclusively discovered another high-risk vulnerability in the move language

Numen Cyber exclusive discovery of another high-risk vulnerability in the move language

Numen Cyber exclusive discovery of another high-risk vulnerability in the move language

Numen Cyber exclusive discovery of another high-risk vulnerability in the move language

Numen Cyber Exclusive Discovery: Another Critical Vulnerability in Move Language

Numen Cyber exclusive discovery of another high-risk vulnerability in the move language

Numen Cyber exclusive discovery of another critical vulnerability in the move language

This vulnerability reminds us that even well-designed languages can have security risks. For the Move language, it is recommended to add more check code at runtime to prevent unexpected situations. Currently, security checks in Move mainly occur during the verification phase, but once the verification is bypassed, it could lead to more serious issues.

As pioneers in the security research of the Move language, we will continue to explore relevant security issues in depth and contribute to the healthy development of the Move ecosystem.

Numen Cyber exclusively discovered another high-risk vulnerability in the move language

MOVE-4.97%
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
  • 6
  • Share
Comment
0/400
TokenUnlockervip
· 08-04 19:18
Why is it an integer overflow again?
View OriginalReply0
BearMarketGardenervip
· 08-04 12:22
Something went wrong with move again.
View OriginalReply0
RunWithRugsvip
· 08-02 18:07
Why is there another security vulnerability?
View OriginalReply0
TestnetFreeloadervip
· 08-02 18:07
There is an Attack Surface again, yay!
View OriginalReply0
JustAnotherWalletvip
· 08-02 18:02
Another incident has occurred, and the review process is to blame.
View OriginalReply0
LiquidityNinjavip
· 08-02 18:01
Also need to fix move haha
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)