0day vulnerability threatens Win system and may endanger the security of Web3 infrastructure

robot
Abstract generation in progress

Microsoft 0day Vulnerability Analysis: Potential Major Threat to Web3 Infrastructure

Last month, a security patch from Microsoft included a publicly exploited elevation of privilege vulnerability in win32k. This vulnerability appears to only exist in earlier Windows systems and cannot be triggered on Windows 11.

The exploitation of such vulnerabilities has a long history. This article will analyze how attackers may continue to exploit this vulnerability in the context of the current ongoing improvements in mitigation measures. We completed the entire analysis process in a Windows Server 2016 environment.

A 0-day vulnerability refers to a flaw that has not been disclosed or patched, which can be exploited by malicious actors without detection, posing significant destructive potential. The recently discovered 0-day vulnerability resides at the Windows system level, allowing hackers to gain complete control over Windows.

A system controlled by hackers may lead to personal information leaks, system crashes, data loss, financial losses, and the implantation of malware. For Web3 users, private keys may be stolen and digital assets transferred. On a broader scale, this vulnerability could even impact the entire Web3 ecosystem running on Web2 infrastructure.

Numen Exclusive: Microsoft 0day Vulnerability Can Upend Web3 Landscape at System + Physical Layer

Patch Analysis

After analyzing the patch, it appears that the issue is simply that the reference count of an object was processed one time too many. Because the win32k code is relatively old, we can find some early source code comments indicating that the previous code only locked the window object, without locking the menu object within the window object, which may have been incorrectly referenced.

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

Proof of Concept for Exploit ( PoC )

We found that the menu passed into xxxEnableMenuItem() is usually locked in the upper-level function. Further analysis reveals that the menus returned by the MenuItemState function in xxxEnableMenuItem can be of two types: the main menu of the window or a submenu in the menu(, or even a submenu of the submenu).

In PoC, we constructed a special four-layer menu structure and set specific properties for each level of the menu to perform detection and judgment through the xxxEnableMenuItem function. Key steps include removing certain menu reference relationships and releasing specific menu objects when xxxRedrawTitle returns to the user layer.

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

Exploiting Vulnerabilities ( Exp ) Implementation

Overall Idea

We mainly considered two types of exploitation directions: executing shellcode and modifying the token address using read-write primitives. Taking various factors into account, we chose the latter.

The entire exp can be divided into two key issues: how to exploit the UAF vulnerability to control the value of cbwndextra, and how to achieve stable read and write primitives after controlling the value of cbwndextra.

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

Implement the first data write

We use the window name object in the window class WNDClass to occupy and release the menu object. The key is to find a location in the address structure that we can build where data can be written arbitrarily.

Finally, we chose to implement the write operation using a flag AND 2 in the xxxRedrawWindow function. We write to the cb-extra of HWNDClass instead of the cb-extra of the window object to better control the memory layout.

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

stable memory layout

We designed a memory layout of at least three consecutive 0x250 byte HWND objects, releasing the middle one and occupying it with a 0x250 byte HWNDClass object. The HWND objects at the front and back are used to verify parameters and as a medium for read and write primitives.

We accurately determine whether the requested window object is arranged as expected by examining the leaked kernel handle address in the heap memory.

Numen Exclusive: Microsoft 0day vulnerability can upend the Web3 landscape at both the system and physical levels

Modification of read/write primitives

We use GetMenuBarInfo() to achieve arbitrary read and SetClassLongPtr() to achieve arbitrary write. Except for the write operation that replaces TOKEN, other writes are completed using the offset of the class object of the first window object.

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

Summary

  1. Although the win32k vulnerability has existed for a long time, Microsoft is attempting to restructure the related kernel code using Rust, and such vulnerabilities may be eliminated in future new systems.

  2. The exploitation process this time is relatively simple, with the main difficulty being how to control the first write. The vulnerability still heavily relies on the leakage of the desktop heap handle address, which remains a security risk for older systems.

  3. The discovery of this vulnerability may benefit from more comprehensive code coverage testing.

  4. For vulnerability exploitation detection, in addition to focusing on the key points of the vulnerability trigger functions, it is also important to specifically detect abnormal memory layouts and window data read and write operations.

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

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
CryptoPhoenixvip
· 9h ago
It’s another opportunity for faith reconstruction! Make sure to back up your Cold Wallet; it’s crucial to exit the bottom range to protect your life.
View OriginalReply0
SignatureVerifiervip
· 13h ago
*sigh* yet another technically insufficient validation... when will they learn to count properly?
Reply0
FlatTaxvip
· 13h ago
Make sure to update the system before talking, be careful not to lose your account.
View OriginalReply0
MysteriousZhangvip
· 13h ago
Still on win, what year is it that we're still running nodes on win?
View OriginalReply0
TooScaredToSellvip
· 13h ago
Stop messing around with the old computer's Wallet, just transfer it quickly.
View OriginalReply0
LootboxPhobiavip
· 13h ago
Scared to death Private Key Cold Wallet sense of security++
View OriginalReply0
CryptoCross-TalkClubvip
· 13h ago
In a Bear Market, we perform cross-talk, in a bull run, we engage in Cryptocurrency Trading, and Microsoft really helped me create a sucker's quick knife.
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)