exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Windows Kernel win32k!fnHkINLPMSLLHOOKSTRUCT Memory Disclosure

Windows Kernel win32k!fnHkINLPMSLLHOOKSTRUCT Memory Disclosure
Posted Feb 22, 2018
Authored by Google Security Research, mjurczyk

The 64-bit Windows kernel suffers from a stack memory disclosure vulnerability in win32k!fnHkINLPMSLLHOOKSTRUCT (via user-mode callback).

tags | advisory, kernel
systems | windows
advisories | CVE-2018-0810
SHA-256 | 39ed1a553dc5ba7854bda24d96724a606df94f6824a594b2c558d95999b97f8b

Windows Kernel win32k!fnHkINLPMSLLHOOKSTRUCT Memory Disclosure

Change Mirror Download
Windows Kernel 64-bit stack memory disclosure in win32k!fnHkINLPMSLLHOOKSTRUCT (via user-mode callback) 

CVE-2018-0810


We have discovered that a user-mode callback invoked by the win32k!fnHkINLPMSLLHOOKSTRUCT function (via KeUserModeCallback) leads to the disclosure of uninitialized stack memory to user-mode clients. The vulnerability affects Windows 7 64-bit; other versions of Windows have not been tested.

The act of copying uninitialized kernel memory has been detected under two different stack traces, shown below:

--- cut ---
#0 0xfffff800026b9830 ((00067830) ntoskrnl.exe!memcpy+00000000)
#1 0xfffff800029b2bf0 ((00360bf0) ntoskrnl.exe!KeUserModeCallback+000000a4)
#2 0xfffff9600020f238 ((0014f238) win32k.sys!fnHkINLPMSLLHOOKSTRUCT+00000088)
#3 0xfffff9600013343e ((0007343e) win32k.sys!xxxHkCallHook+0000029a)
#4 0xfffff96000150c8b ((00090c8b) win32k.sys!xxxCallHook2+000004b7)
#5 0xfffff960001be4c6 ((000fe4c6) win32k.sys!xxxMoveEventAbsolute+000000ca)
#6 0xfffff960001be6f5 ((000fe6f5) win32k.sys!xxxMoveEvent+000000a1)
#7 0xfffff960001bff4a ((000fff4a) win32k.sys!xxxMouseEventDirect+0000028e)
#8 0xfffff960001c032f ((0010032f) win32k.sys!xxxSendInput+000000e3)
#9 0xfffff960001a36aa ((000e36aa) win32k.sys!NtUserSendInput+00000112)
#10 0xfffff800026c2093 ((00070093) ntoskrnl.exe!KiSystemServiceCopyEnd+00000013)
--- cut ---
#0 0xfffff800026b9830 ((00067830) ntoskrnl.exe!memcpy+00000000)
#1 0xfffff800029b2bf0 ((00360bf0) ntoskrnl.exe!KeUserModeCallback+000000a4)
#2 0xfffff9600020f238 ((0014f238) win32k.sys!fnHkINLPMSLLHOOKSTRUCT+00000088)
#3 0xfffff9600013343e ((0007343e) win32k.sys!xxxHkCallHook+0000029a)
#4 0xfffff96000150c8b ((00090c8b) win32k.sys!xxxCallHook2+000004b7)
#5 0xfffff960001bbc54 ((000fbc54) win32k.sys!xxxButtonEvent+000004f8)
#6 0xfffff960001bc9fc ((000fc9fc) win32k.sys!xxxDoButtonEvent+000001a8)
#7 0xfffff960001c0b14 ((00100b14) win32k.sys!ProcessQueuedMouseEvents+000002c8)
#8 0xfffff960001bff83 ((000fff83) win32k.sys!xxxMouseEventDirect+000002c7)
#9 0xfffff960001c032f ((0010032f) win32k.sys!xxxSendInput+000000e3)
#10 0xfffff960001a36aa ((000e36aa) win32k.sys!NtUserSendInput+00000112)
#11 0xfffff800026c2093 ((00070093) ntoskrnl.exe!KiSystemServiceCopyEnd+00000013)
--- cut ---

At that point of execution, 0x40 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: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000030: 00 00 00 00 ff ff ff ff 00 00 00 00 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 4 bytes leaked at offsets 0x34-37. We have determined that these bytes originally come from a smaller structure of size 0x20, which is passed down to win32k!fnHkINLPMSLLHOOKSTRUCT through the 3rd argument, and copied into offset 0x20 of the overall memory area passed to ring-3.

More specifically, we have found that the nested structure is allocated in the stack frame of the caller of win32k!xxxCallHook2 (so win32k!xxxMoveEventAbsolute and win32k!xxxButtonEvent in our case), and is most likely of type MSLLHOOKSTRUCT. If true, the uninitialized bytes correspond to the 4 bytes of padding between the time and dwExtraInfo fields, inserted by the compiler to align the latter to an 8-byte boundary.

--- cut ---
typedef struct tagMSLLHOOKSTRUCT {
POINT pt;
DWORD mouseData;
DWORD flags;
DWORD time;
ULONG_PTR dwExtraInfo;
} MSLLHOOKSTRUCT, *PMSLLHOOKSTRUCT, *LPMSLLHOOKSTRUCT;
--- cut ---

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

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 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

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close