Gone in 5 Seconds: How WARN_ON Stole 10 Minutes
A use-after-free in the Android kernel's memory management allowed an attacker to free a page while it was still mapped, then reclaim it with controlled data to achieve arbitrary kernel code execution. The write-up explains the root cause and an alternative exploitation technique for CVE-2023-6241.
starlabs.sg
Published on starlabs.sg
As part of my internship at STAR Labs, I was tasked to conduct N-day analysis of CVE-2023-6241. The original PoC can be found here, along with the accompanying write-up.
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 race or reference-counting mistake in the kernel's page management left a freed page still reachable and mapped.
Impact
An attacker could achieve arbitrary kernel code execution on a Pixel 8 running an unpatched build.
What the attacker needed
Android kernel vulnerable to CVE-2023-6241; ability to run code on the device
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.
A use-after-free happens when a program frees a piece of memory but keeps using it, so an attacker can put their own data in that space. Here the memory was a page in the phone's kernel, the core of the operating system, and taking it over let the attacker run their own code with the highest privileges.
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.