Foxit PDF Reader Javascript importDataObject Remote Code Execution Vulnerability
A use-after-free flaw in Foxit PDF Reader's JavaScript engine allows a crafted PDF to trigger reuse of freed memory, potentially leading to arbitrary code execution. An attacker must convince the user to open the malicious file or visit 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
Likely a use-after-free in the JavaScript engine's handling of page open/close events and document actions, where an object is freed but later dereferenced.
Impact
This could allow an attacker to execute arbitrary code, and if the browser plugin is enabled, visiting a malicious site can also trigger the vulnerability.
What the attacker needed
Victim opens malicious PDF; or victim visits malicious site (plugin enabled)
The fix
The vulnerability was fixed by the vendor in version 9.2.0.9297 according to the timeline.
How it was found
- Create a multipage PDF with JavaScript actions on page open and close events.
- In the page open event, call app.activeDocs[0].calculateNow() to allocate an extra object.
- In the document open action, call app.activeDocs[0].importDataObject() to dereference the freed object.
- Open the PDF in Foxit Reader to trigger the crash.
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 happens when a program frees memory but then keeps using it, like deleting a file and still trying to open it. Here, a malicious PDF tricks the reader into freeing an object and then using it again, which can let an attacker run their own code on the victim's computer. The victim just needs to open the PDF or visit a malicious site if the browser plugin is active.
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.