Foxit PDF Reader Javascript Field Action Validate Remote Code Execution Vulnerability
A use-after-free flaw in Foxit PDF Reader's JavaScript engine lets a crafted PDF free a list box object and then reuse it during a Validate field action. An attacker who gets a victim to open the file, or visit a malicious site with the browser plugin enabled, could run arbitrary code.
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.7.0.29435. 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 the list box handling frees the underlying object during a Validate event handler but the engine still references it after the handler returns, before reuse.
Impact
An attacker could achieve arbitrary code execution, but only if the user opens the malicious file or, with the browser plugin enabled, visits a malicious site.
What the attacker needed
Victim opens a crafted PDF; or browser plugin enabled and victim visits a site
How it was found
- Open a crafted PDF containing a list box field with a Validate action.
- The script inserts an item and attaches a handler to the Validate action.
- The script deletes the item, freeing the object.
- The Validate handler runs and sets new items on the list box.
- The freed object is reused after the handler finishes, causing 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 PDF can contain small scripts that run when a form field changes. This reader frees a piece of memory holding a list box but keeps using it afterwards, so an attacker can put their own data in that gap and steer the program. The result is that the attacker's code can run on the victim's computer.
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.