Foxit PDF Reader JavaScript page change remote code execution vulnerability
A use-after-free in Foxit PDF Reader's JavaScript engine allows a crafted PDF to trigger reuse of freed memory, leading to arbitrary code execution. An attacker can achieve this by tricking a user into opening a malicious file or visiting a malicious site if the browser plugin is enabled.
Originally disclosed on Cisco Talos
An exploitable use-after-free vulnerability exists in the JavaScript engine of Foxit Software’s Foxit PDF Reader, version 9.2.0.9297. A specially crafted PDF document can trigger a previously freed object in memory to be reused, resulting in arbitrary code execution.
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
The JavaScript engine allows a document to be closed while JavaScript continues to execute, and changing the page after closure reuses freed objects.
Impact
An attacker could execute arbitrary code on the victim's machine, and if the browser plugin is enabled, visiting a malicious site could also trigger the vulnerability.
What the attacker needed
Victim opens a malicious PDF; or victim visits a malicious site if plugin enabled
The fix
The vulnerability was fixed by the vendor in a patch released on 2018-09-28.
How it was found
- Open the crafted PDF in Foxit Reader.
- The document open action focuses the first page, triggering its page open action.
- The page open action sets focus to the second page, which triggers the close action of page one.
- That close action closes the document, freeing many objects.
- The page focus is then changed, triggering the use-after-free.
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 use-after-free is a memory bug where a program keeps using a chunk of memory after it has been freed. Here, a PDF's JavaScript can close the document and then change the page, causing the program to use freed memory. An attacker can control that memory and make the program run their code.
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.