Adobe Acrobat Reader DC OCGs state change remote code execution vulnerability
A crafted PDF with embedded JavaScript can free an object tied to an optional content group and then reuse that freed memory, causing heap corruption in Adobe Acrobat Reader DC. With careful memory manipulation this could lead to arbitrary code execution when the victim opens the file or visits a malicious page.
Originally disclosed on Cisco Talos
A specific JavaScript code embedded in a PDF file can lead to a heap corruption when opening a PDF document in Adobe Acrobat Reader DC, version 2019.10.20069. This can lead to arbitrary code execution with careful memory manipulation.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a use-after-free: changing an optional content group's state frees an object that is still referenced after the page switch, so later code reads or writes freed memory.
Impact
This could result in further memory corruption and ultimately lead to arbitrary code execution, though the text only demonstrates a crash and describes code execution as a possibility with careful memory control.
What the attacker needed
Victim opens a malicious PDF; victim visits a malicious web page; multi-page PDF with embedded JavaScript
How it was found
- Open a multi-page PDF whose document open action sets a text field value and jumps to the second page.
- The second page's open action selects a word on the first page, switching focus back.
- The second page's close action changes the state of an optional content group, freeing an object.
- Returning to the first page reuses the freed memory, and the reader later dereferences it and crashes.
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 report has not been written yet. The Original tab links to the source.
A PDF can contain small programs (JavaScript) that run when the document opens. In this case, switching between pages and turning a layered content group on or off made the reader free a piece of memory and then keep using it, which is called a use-after-free. An attacker who controls what fills that freed memory could take over the program, but the victim must first open a malicious PDF.
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.