Analysis of Windows Kernel 0day Vulnerabilities: Threats to Web3 Asset Security

Analysis and Exploitation of Microsoft Windows System 0day Vulnerabilities

Recently, a Windows kernel privilege escalation vulnerability exploited by hackers in the wild was fixed in a Microsoft security patch. This vulnerability primarily exists in earlier versions of Windows systems, rather than Windows 11. This article will analyze how attackers continue to exploit this vulnerability in the context of continuously improving current security measures.

Numen Exclusive: Microsoft 0day Vulnerability Can Disrupt Web3 Landscape at System and Physical Levels

Vulnerability Background

This is a Windows system-level 0day vulnerability that allows attackers to gain complete control over Windows. The consequences of being compromised include personal information leakage, system crashes, data loss, financial losses, and malware implantation. For Web3 users, private keys may be stolen, and digital assets face the risk of being transferred. On a larger scale, this vulnerability may affect the Web3 ecosystem that operates on Web2 infrastructure.

Numen Exclusive: Microsoft 0day Vulnerability Can Disrupt Web3 Landscape at System + Physical Levels

Patch Analysis

Analyzing the patch code reveals that this seems to be an issue with the object reference count being handled too many times. Early source code comments indicate that the previous code only locked the window object and did not lock the menu object within the window object, which may lead to the menu object being incorrectly referenced.

Numen Exclusive: Microsoft 0day Vulnerability Can Disrupt Web3 Landscape at System + Physical Level

Vulnerability Reproduction

We constructed a special four-layer menu structure to trigger vulnerabilities. These menus need to meet certain specific conditions to pass the detection of related functions. Ultimately, when returning to the user layer, the target menu object is released by removing the reference relationships between the menus, rendering subsequent references to that object invalid.

Numen Exclusive: Microsoft 0day vulnerability can overturn the Web3 game on both system and physical levels

Exploit

The main idea of exploiting this vulnerability is to modify the token address through read and write primitives. The entire exploitation process can be divided into two key steps: first, how to control the value of cbwndextra using the UAF vulnerability, and second, how to establish stable read and write primitives based on the controlled value of cbwndextra.

We successfully achieved the first data write by carefully designing the memory layout and leveraging the relationship between the window object and the HWNDClass object. Subsequently, we constructed the required memory structure by continuously allocating three HWND objects and releasing the middle one.

Numen Exclusive: Microsoft 0day Vulnerability Can Disrupt Web3 Landscape at System and Physical Levels

In terms of reading and writing primitives, we use GetMenuBarInfo() for arbitrary reading and SetClassLongPtr() for arbitrary writing. Except for the TOKEN replacement operation, other writes are completed by utilizing the class object of the first window object through offsets.

Numen Exclusive: Microsoft 0day Vulnerability Can Disrupt Web3 Landscape at System and Physical Levels

Summary

  1. Microsoft is attempting to refactor the win32k related code using Rust, and such vulnerabilities may be eliminated in the new system in the future.

  2. The exploitation process of this vulnerability is relatively simple, with the main difficulty being how to control the first write.

  3. The discovery of vulnerabilities may rely on more comprehensive code coverage detection.

  4. For vulnerability detection, in addition to focusing on key function points, targeted detection of abnormal memory layouts and data read/write operations should also be conducted.

Numen Exclusive: Microsoft 0day Vulnerability Can Disrupt Web3 Landscape at System and Physical Levels

Numen Exclusive: Microsoft 0day Vulnerability Can Disrupt Web3 Landscape on System and Physical Levels

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
wrekt_but_learningvip
· 18h ago
The system is going to be repaired again...
View OriginalReply0
BearEatsAllvip
· 07-12 17:59
Why not hurry to change the old system?
View OriginalReply0
ZkSnarkervip
· 07-12 17:55
fun fact: still running windows 7 in prod tbh
Reply0
NightAirdroppervip
· 07-12 17:46
Wuhu bull批... Hard disk explosion warning
View OriginalReply0
ser_we_are_earlyvip
· 07-12 17:46
Is win7 buddy still around?
View OriginalReply0
GasFeeAssassinvip
· 07-12 17:46
Just woke up, feel safer without system security patch updates.
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)