2.
Vulnerability Information

3.
Vulnerability Description

A crash due to an invalid read in the Windows kernel can be reliably leveraged into privileged code execution resulting in a privilege escalation local vulnerability. This happens because special values of hParent where not sufficiently taken into account when patching xxxCreateWindowsEx on MS010-032[1]. >

4.
Vulnerable packages

At least all supported versions of Windows were reported by Microsoft to be vulnerable:

6.
Vendor Information, Solutions and Workarounds

7.
Credits

This vulnerability was discovered by Nicolás Economou from Core Security Technologies.

8.
Technical Description / Proof of Concept Code

There is a bug in the xxxCreateWindowEx Windows kernel function, located in win32k.sys. This function addresses memory with a user-supplied (via a callback) window pseudo-handle (the hParent parameter). This bug can be exploited by surreptitiously registering a callback or "hook" that will cleverly modify parameters passed by the kernel into userland that are then reused when returning to kernel from the callback.

In normal execution when the CreateWindow is called from userspace, the NtUserCreateWindowEx kernel function is executed, the xxxCreateWindowEx is next in the kernel-side call stack. The later function then checks that the callback functions (or "hooks") where properly set and calls xxxCallHook which then starts the dispatch into userland of the registered callback functions.

The problem resides in the mechanism used to pass parameters back to the process creating the window, like for example the aforementioned hParent parameter. These parameters are passed via the stack into userspace, and reused by the kernel after the callback function is executed. If the callback function resets the hParent parameter to pseudo-handle values like 0xffffffff or 0xfffffffe the kernel crashes (likely because validation of handle values was already done and was not being re-verified after executing untrusted userland code).

The following code reliably crashes a fully patched version of Windows XP 32 bits when executed as an unprivileged user. On version 5.1.2600.5976 of win32k.sys the crash occurs on 0xbf832763 (xxxCreateWindowEx) when reading from unmapped memory (test byte ptr [eax+0x1c],0x8). The value of eax on the crash is 0xfffffffe, the supplied vulnerable hParent value.

9.
Report Timeline

2010-06-15: Initial notification to the vendor. Core indicates that the patch from MS10-032 does not seem to fix the problem and send a PoC that work on fully patched systems. Asks Microsoft to determine if it is a newly found vulnerability or simply a quality issue with the patch issued on n June's Patch Tuesday.

2010-06-16: Vendor acknowledges notification and says that the product team will look into the issue.

2010-06-17: Vendor asks for a stacktrace and crash dump file to confirm that they're reproducing the same issue.

2010-06-15: Core sends stacktrace and crash dump and asks to confirm that the bug could be reproduced with the PoC sent earlier.

2010-06-17: Vendor confirms that the bug has been reproduced. Can't determine if it is a new bug, a variant of an existing one or an incomplete fix but expects to have more information by the 20th or 21st at the latest.

2010-06-23: Update from the vendor (email sent previously bounced). The issue has been determined to be a variant of CVE-2010-0485. It will be addressed as a new bug and assigned a different CVE ID. Although the crash comes from the same vector (a window handle returned by a user mode windows hook callback) the bug is in a different function than the original issue and occurs due to a different, previously unknown, issue with the window handle that the original fix does not address. A solid timeline for general availability of patches is not yet available. The July 2010 Patch Tuesday day is mentioned as tentative but the patch release may slip to August.

2010-06-23: Core says that its analysis coincides with the vendor's and therefore it will treat the issue as a new vulnerability assigning CORE-2010-0623 to the corresponding security advisory. The discoverer estimated that the issue is very likely to be exploitable. Publication is tentatively scheduled for July 13th, 2010 but may be postponed based on a firm commitment from MSRC and indication that the fix is lined up for testing. Core mentions that it is very likely that vulnerability research vendors have already found this issue and quite possible that exploits are already being developed. Should the information become public by a third-party Core will promptly publish its security advisory and notify the vendor.

2010-07-23: Core asks Microsoft to confirm that the patch has been positively rescheduled to the August patch Tuesday, since no communications where received on the last month and July's patch Tuesday is due. Core also informs that reliable exploitation of this bug had been achieved and restates that August should be a final date because this vulnerability has probably been already discovered by any with technical knowledge to reverse engineer MS010-032. Information on affected platforms is also asked for to Microsoft.

2010-07-23: Microsoft confirms that the patch will be issued in August 10th, for all supported versions of Microsoft Windows.

2010-08-04: Core asks Microsoft for data regarding their future security bulletin in order to include it in the vendor section of this advisory.

2010-08-04: Microsoft replies with the data Core asked for, and mentions that, if possible, they would like to see an advisory draft. Microsoft also asks for confirmation on credits for the acknowledgement section of their report.

2010-08-04: Core replies with a draft of this advisory and a minor correction regarding an accent mark on the credits for the acknowledgement section.

10.
References

11.
About CoreLabs

CoreLabs, the research center of Core Security Technologies, is charged with anticipating the future needs and requirements for information security technologies. We conduct our research in several important areas of computer security including system vulnerabilities, cyber attack planning and simulation, source code auditing, and cryptography. Our results include problem formalization, identification of vulnerabilities, novel solutions and prototypes for new technologies. CoreLabs regularly publishes security advisories, technical papers, project information and shared software tools for public use at: http://corelabs.coresecurity.com/.

12.
About Core Security Technologies

Core Security Technologies develops strategic solutions that help security-conscious organizations worldwide develop and maintain a proactive process for securing their networks. The company's flagship product, CORE IMPACT, is the most comprehensive product for performing enterprise security assurance testing. CORE IMPACT evaluates network, endpoint and end-user vulnerabilities and identifies what resources are exposed. It enables organizations to determine if current security investments are detecting and preventing attacks. Core Security Technologies augments its leading technology solution with world-class security consulting services, including penetration testing and software security auditing. Based in Boston, MA and Buenos Aires, Argentina, Core Security Technologies can be reached at 617-399-6980 or on the Web at http://www.coresecurity.com.