Taking apart a double zero-day sample discovered in joint hunt with ESET
A PDF sample contained two zero-day exploits: one in Adobe Acrobat/Reader's JPEG 2000 handling that allowed code execution, and a Windows kernel elevation-of-privilege flaw (CVE-2018-8120) that let that code escape the sandbox and gain SYSTEM privileges on Windows 7 and Server 2008. The sample was proof-of-concept and no actual attacks were observed.
cloudblogs.microsoft.com
Published on cloudblogs.microsoft.com
In late March 2018, I analyzed an interesting PDF sample found by ESET senior malware researcher Anton Cherepanov. The sample was initially reported to Microsoft as a potential exploit for an unknown Windows kernel vulnerability.
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 an out-of-bounds memory free in Adobe's JPEG 2000 parser (due to a length mismatch between CMAP and PCLR tags) and a NULL page dereference in the Win32k SetImeInfoEx function.
Impact
An attacker could run shellcode in Adobe Reader and, on Windows 7 and Server 2008, elevate to SYSTEM privileges; Windows 10 was not affected due to platform hardening.
What the attacker needed
Victim opens a malicious PDF; Adobe Reader with JavaScript enabled; Windows 7 SP1 or Server 2008 for EoP
The fix
Adobe and Microsoft released security updates for CVE-2018-4990 and CVE-2018-8120, and users were advised to disable JavaScript in Acrobat/Reader if not needed.
How it was found
- JavaScript lays out heap spray memory.
- Malicious JPEG 2000 stream triggers an out-of-bounds access operation.
- The access operation is called upon out-of-bounds memory laid out by the heap spray.
- The access operation corrupts the virtual function table (vftable).
- The corrupted vftable transfers execution to a return-oriented programming (ROP) chain.
- The ROP chain transfers execution to the main shellcode.
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 malicious PDF file that contained two separate software flaws. The first flaw let the PDF run harmful code inside Adobe Reader, and the second flaw let that code break out of Reader's protective sandbox and take full control of older Windows computers. The PDF was a test file, not a real attack, and both companies released fixes.
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.