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



Sign in to add a comment
iPrint Client: nipplpt.sys Error Logging Handle Use After Free
Project Member Reported by forshaw@google.com, Feb 27 2015 Back to list
iPrint Client: nipplpt.sys Error Logging Handle Use After Free
Platform: iPrint Client 5.99, tested on Windows 8.1 Update 32
Class: Elevation of Privilege/Denial of Service

Summary:
The nipplpt.sys driver doesn’t check the return code when creating a log file during error logging leading to reusing a kernel handle. This can lead to elevation of privilege or local denial of service.

Description:

The  nipplpt.sys driver logs errors in its own thread using a simple linked list to pass new log strings. Each time the log file is to be written to it opens the log file for exclusive access. The return code from the create file call isn’t checked to ensure the file was opened and the handle value is never cleared so by locking the log file as a user process and causing a log event to occurs it’s possible to get the driver to reuse the last value stored in the handle variable. 

This has a number of consequences. If a new handle is opened with the same value by another kernel component then it can cause file corruption due to the errant write call. Also the call to ZwClose could fail due to an invalid handle leading to a bug check or it could close another system’s handle which that then fails. Finally it could allow a handle to be closed which the kernel assumes was opened then another handle opened in its place which could lead to elevation of privilege through a user after free scenario. 

The handle variable should be cleared after close and the result of the create file call checked before reuse. 

The code looks something like:

HANDLE FileHandle;

while(true)
{
	// Wait for new log event
	CreateLogFile(L"\\??\\C:\\NDPS\\DOSBOX\\NIPPLPTS.LOG", &FileHandle); <- No check made on result

	ZwWriteFile(FileHandle, …); <- FileHandle uninitialized or same as last value
	ZwClose(FileHandle); 
}

Proof of Concept:

I’ve provided a PoC as source code, it will need to be compiled with something like Visual Studio. It will typically demonstrate a kernel bug check. Note that it does use one of the other bugs to guarantee a log message is written however this isn’t required, for example it would be possible to cause a write failure through using up disk space temporarily or other resource constraints. This has only been tested on 32 bit Windows platforms, it should be run as a normal privileged user and not as an administrator. I’ve attached as well an example crash from an invalid handle being closed. 

Expected Result:
The log event should fail gracefully

Observed Result:
Typically a bug check occurs. 

This bug is subject to a 90 day disclosure deadline. If 90 days elapse without a broadly available patch, then the bug report will automatically become visible to the public.
 
Project Member Comment 1 by forshaw@google.com, Feb 27 2015
Re-added attachments.
NovellDriverTest_HandleUAF.zip
10.6 KB Download
crash.txt
9.2 KB View Download
Project Member Comment 2 by forshaw@google.com, Mar 2 2015
Labels: -Reported-2015-02-27 Reported-2015-Feb-27
Received confirmation that security@novell.com had received the reports
Project Member Comment 3 by forshaw@google.com, May 28 2015
Correspondence Date: 22 May 2015

> Asked Novell for an update on this vulnerability as it's about to exceed the deadline
Project Member Comment 4 by forshaw@google.com, May 28 2015
Labels: -Restrict-View-Commit Deadline-Exceeded
Deadline exceeded -- automatically derestricting
Project Member Comment 5 by forshaw@google.com, Jun 4 2015
Status: Fixed
Issue has been resolved, according to vendor, by removing the vulnerable driver from version 6.0.0 onward. This was not documented in the release notes at https://www.novell.com/support/kb/doc.php?id=7008708
Project Member Comment 6 by forshaw@google.com, Jul 9 2015
Labels: -Deadline-Exceeded
Removed deadline exceeded as technically the bugs were fixed prior to the deadline. Although auto update is not enabled and there was no corresponding advisory warning customers to upgrade.
Sign in to add a comment