Foxit PDF Reader JavaScript setPersistent Remote Code Execution Vulnerability
A specially crafted PDF with XFA forms and JavaScript calling setPersistent causes an uninitialized pointer dereference in Foxit PDF Reader. An attacker who tricks a user into opening the file could potentially execute arbitrary code if they control the uninitialized memory.
Originally disclosed on Cisco Talos
An exploitable use of an uninitialized pointer vulnerability exists in the JavaScript engine in Foxit PDF Reader version 9.0.1.1049. A specially crafted PDF document can lead to a dereference of an uninitialized pointer which, if under attacker control, can result 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 the JavaScript engine fails to initialize a pointer before using it as a 'this' pointer in a function call, leading to a dereference of uninitialized memory.
Impact
If an attacker can control the uninitialized memory, they could achieve arbitrary code execution; otherwise it causes a crash.
What the attacker needed
Victim opens a malicious PDF; Foxit PDF Reader 9.0.1.1049
The fix
The vulnerability was fixed in a vendor patch released on 2018-04-19.
How it was found
- Create a PDF document containing XFA forms.
- Embed JavaScript code that calls this.global.setPersistent().
- Open the PDF in Foxit PDF Reader 9.0.1.1049.
- The uninitialized pointer is dereferenced, causing a 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.
This report describes a bug in a PDF reader where a malicious PDF file can make the program use memory that was never properly set up. If an attacker can control what is in that memory, they might be able to run their own code on the victim's computer. The victim just needs to open the PDF file.
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.