Exploit the possiblities

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

File Archive:

December 2017

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2016 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close