Twenty Year Anniversary

Microsoft Windows win32k!xxxSendMenuSelect Memory Disclosure

Microsoft Windows win32k!xxxSendMenuSelect Memory Disclosure
Posted Nov 21, 2017
Authored by Google Security Research, mjurczyk

There is a Microsoft Windows kernel stack memory disclosure vulnerability in win32k!xxxSendMenuSelect via fnHkINLPMSG user-mode callback.

tags | advisory, kernel
systems | windows
advisories | CVE-2017-11853
MD5 | df47cad4c0563e46c4d01e39c825ee89

Microsoft Windows win32k!xxxSendMenuSelect Memory Disclosure

Change Mirror Download
Windows Kernel stack memory disclosure in win32k!xxxSendMenuSelect (via fnHkINLPMSG user-mode callback) 

CVE-2017-11853


We have discovered that the win32k!xxxSendMenuSelect function has a bug which leads to the disclosure of uninitialized stack memory to user-mode clients, due to unused fields in a structure which ends up copied to userland.

The act of copying uninitialized kernel memory was originally detected under the following stack trace:

--- cut ---
957836ec 82abe89d nt!memcpy+0x35
95783748 91161d46 nt!KeUserModeCallback+0xc6
957837ec 9111ffe8 win32k!fnHkINLPMSG+0x148
9578384c 911658b3 win32k!xxxHkCallHook+0x337
957838ec 9115ab70 win32k!xxxCallHook2+0x3ac
95783908 91227798 win32k!xxxCallHook+0x26
95783928 9121acd1 win32k!_CallMsgFilter+0x71
95783960 911f22aa win32k!xxxSendMenuSelect+0xce
957839c0 9120f5a9 win32k!xxxMNInvertItem+0x3ae
95783a2c 912452f9 win32k!xxxMNSelectItem+0x216
95783aa0 912141a4 win32k!xxxRealMenuWindowProc+0xba3
95783ad4 9118c593 win32k!xxxMenuWindowProc+0xfd
95783b14 9118c665 win32k!xxxSendMessageTimeout+0x1ac
95783b3c 9120f0d5 win32k!xxxSendMessage+0x28
95783b8c 9120ebcc win32k!xxxMNMouseMove+0x177
95783be8 9120e784 win32k!xxxHandleMenuMessages+0x310
95783c34 912147d3 win32k!xxxMNLoop+0x2fa
95783ca0 912148be win32k!xxxTrackPopupMenuEx+0x5fd
95783d14 8287ee06 win32k!NtUserTrackPopupMenuEx+0xc3
95783d14 77236c74 nt!KiSystemServicePostCall
000bf210 757a480e ntdll!KiFastSystemCallRet
000bf214 0055342c USER32!NtUserTrackPopupMenuEx+0xc
--- cut ---

At that point of execution, 0x30 bytes are copied from kernel to user-mode. The layout of the i/o structure passed down to the user-mode callback that we're seeing is as follows:

--- cut ---
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000020: ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 ................
--- cut ---

Where 00 denote bytes which are properly initialized, while ff indicate uninitialized values copied back to user-mode. As shown above, there are 12 bytes leaked at offsets 0x20-0x2b. We have determined that these bytes originally come from a smaller structure of size 0x1c, allocated in the stack frame of the win32k!xxxSendMenuSelect function. More specifically, we have found that the local structure is in fact of type MSG, and the uninitialized bytes correspond to the trailing "time" and "pt" fields:

--- cut ---
typedef struct tagMSG {
HWND hwnd;
UINT message;
WPARAM wParam;
LPARAM lParam;
DWORD time;
POINT pt;
} MSG, *PMSG, *LPMSG;
--- cut ---

Such a partially initialized structure is then passed down to win32k!_CallMsgFilter, and further down the call stack, before being eventually leaked to ring-3 through the user-mode callback. A proof-of-concept program is not provided for this issue, but it has been observed and confirmed at normal system runtime, and is quite evident in the code.

Repeatedly triggering the vulnerability could allow local authenticated attackers to defeat certain exploit mitigations (kernel ASLR) or read other secrets stored in the kernel address space.

This bug is subject to a 90 day disclosure deadline. After 90 days elapse or a patch has been made broadly available, the bug report will become visible to the public.



Found by: mjurczyk

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

Want To Donate?


Bitcoin: 18PFeCVLwpmaBuQqd5xAYZ8bZdvbyEWMmU

File Archive:

April 2018

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    5 Files
  • 2
    Apr 2nd
    17 Files
  • 3
    Apr 3rd
    11 Files
  • 4
    Apr 4th
    21 Files
  • 5
    Apr 5th
    17 Files
  • 6
    Apr 6th
    12 Files
  • 7
    Apr 7th
    1 Files
  • 8
    Apr 8th
    6 Files
  • 9
    Apr 9th
    21 Files
  • 10
    Apr 10th
    18 Files
  • 11
    Apr 11th
    42 Files
  • 12
    Apr 12th
    7 Files
  • 13
    Apr 13th
    14 Files
  • 14
    Apr 14th
    1 Files
  • 15
    Apr 15th
    1 Files
  • 16
    Apr 16th
    15 Files
  • 17
    Apr 17th
    20 Files
  • 18
    Apr 18th
    24 Files
  • 19
    Apr 19th
    20 Files
  • 20
    Apr 20th
    7 Files
  • 21
    Apr 21st
    10 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2018 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close