New issue
Advanced search Search tips
Starred by 2 users
Status: Fixed
Owner:
Closed: May 2017
Cc:



Sign in to add a comment
Windows Kernel uninitialized memory in the default dacl descriptor of system processes' token
Project Member Reported by mjurczyk@google.com, Feb 23 2017 Back to list
We have observed (on Windows 7 32-bit) that for unclear reasons, the kernel-mode structure containing the default DACL of system processes' tokens (lsass.exe, services.exe, ...) has 8 uninitialized bytes at the end, as the size of the structure (ACL.AclSize) is larger than the sum of ACE lengths (ACE_HEADER.AceSize). It is possible to read the leftover pool data using a GetTokenInformation(TokenDefaultDacl) call.

When the attached proof-of-concept code is run against a SYSTEM process (pid of the process must be passed in the program argument), on a system with Special Pools enabled for ntoskrnl.exe, output similar to the following can be observed:

>NtQueryInformationToken.exe 520
00000000: 54 bf 2b 00 02 00 3c 00 02 00 00 00 00 00 14 00 T.+...<.........
00000010: 00 00 00 10 01 01 00 00 00 00 00 05 12 00 00 00 ................
00000020: 00 00 18 00 00 00 02 a0 01 02 00 00 00 00 00 05 ................
00000030: 20 00 00 00 20 02 00 00[01 01 01 01 01 01 01 01] ... ...........

The last eight 0x01 bytes are markers inserted by Special Pools, which visibly haven't been overwritten by any actual data prior to being returned to user-mode.

While reading DACLs of system processes may require special privileges (such as the ability to acquire SeDebugPrivilege), the root cause of the behavior could potentially make it possible to also create uninitialized DACLs that are easily accessible by regular users. This could in turn lead to a typical kernel memory disclosure condition, which would allow local authenticated attackers to defeat certain exploit mitigations (kernel ASLR) or read other secrets stored in the kernel address space. Since it's not clear to us what causes the abberant behavior, we're reporting it for further analysis to be on the safe side.

The proof-of-concept code is mostly based on the example at https://support.microsoft.com/en-us/help/131065/how-to-obtain-a-handle-to-any-process-with-sedebugprivilege.

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.

 
NtQueryInformationToken.cpp
4.9 KB View Download
Project Member Comment 1 by mjurczyk@google.com, Mar 1 2017
Labels: Reported-2017-Mar-1
Project Member Comment 2 by mjurczyk@google.com, Mar 1 2017
Labels: MSRC-37638
Project Member Comment 3 by mjurczyk@google.com, Mar 9 2017
Labels: Deadline-Exceeded Deadline-Grace
MSRC have requested the grace period extension aiming to fix on June 2017 Patch Tuesday.
Project Member Comment 4 by mjurczyk@google.com, May 10 2017
Labels: -Deadline-Grace -Deadline-Exceeded Fixed-2017-May-9 CVE-2017-0258
Status: Fixed
Fixed in yesterday's Patch Tuesday. Removing the "Deadline" labels because the deadline was not exceeded and grace period was not used.
Project Member Comment 5 by mjurczyk@google.com, May 15 2017
Labels: -Restrict-View-Commit
Sign in to add a comment