Skip to content
Memory corruption Write-up Advanced

Windows 0-day exploit used in Operation WizardOpium

A Windows kernel privilege escalation vulnerability in win32k.sys was exploited as a zero-day in Operation WizardOpium, allowing an attacker to gain higher privileges and escape the Chrome sandbox. The exploit used a crafted sequence of WinAPI calls to trigger a use-after-free in window switching functionality, then achieved arbitrary kernel read/write to overwrite process tokens.

securelist.com

Published on securelist.com

In November 2019, Kaspersky technologies successfully detected a Google Chrome 0-day exploit that was used in Operation WizardOpium attacks. During our investigation, we discovered that yet another 0-day exploit was used in those attacks.

The author, on securelist.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a use-after-free or similar memory corruption in the win32k.sys driver's window switching functionality, triggered by a crafted sequence of WinAPI calls.

Impact

The exploit could gain higher privileges on the infected machine and escape the Chrome process sandbox, but new Windows 10 builds are not affected because they implement measures that prevent the normal usage of the exploitable code.

What the attacker needed

Victim runs vulnerable Windows version; attacker can execute code in Chrome renderer

How it was found

  1. The exploit finds the OS version and leaks kernel pointers using known techniques.
  2. It creates a special memory layout with holes in the heap using many calls to CreateAcceleratorTable/DestroyAcceleratorTable.
  3. It performs a bunch of calls to CreateBitmap and leaks their addresses via a handle table array.
  4. It creates pop-up windows and calls NtUserMessageCall with their window handles.
  5. It creates a special window with the class of a task switch window (#32771) and emulates the Alt key.
  6. It uses SetBitmapBits to craft a GDI object with a controllable pointer, then calls NtUserMessageCall again to trigger the vulnerable code path and achieve arbitrary kernel read/write.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This report describes a security flaw in Windows that let an attacker take control of a computer. The flaw was in a core Windows component that handles window switching, and attackers could use it to gain higher privileges and break out of the browser's protective sandbox. The exploit was used in real attacks alongside a Chrome zero-day.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.