Foxit Reader Field Calculate event use-after-free vulnerability
A use-after-free vulnerability exists in Foxit Reader's JavaScript engine when handling form field events, allowing an attacker to execute arbitrary code by tricking a user into opening a malicious PDF. The vulnerability can also be triggered via a malicious website if the browser plugin is enabled.
Originally disclosed on Cisco Talos
A use-after-free vulnerability exists in the JavaScript engine of Foxit Software’s PDF Reader, version 12.1.2.15332. By prematurely deleting objects associated with pages, a specially crafted PDF document can trigger the reuse of previously freed memory, which can lead to 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 frees objects when a Calculate action deletes pages, but then uses a pointer to one of those freed objects without validating it.
Impact
This could lead to arbitrary code execution, and exploitation is also possible if a user visits a malicious site with the browser plugin enabled.
What the attacker needed
Victim opens a malicious PDF; or victim visits a malicious site with plugin
The fix
The vulnerability was fixed by the vendor in version 12.1.2.15332 and later, as indicated by the patch release.
How it was found
- Set a Calculate action on a form field that deletes pages.
- Trigger the Calculate action by focusing another field.
- The action deletes pages, freeing many objects.
- The freed object is later used without validation, 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 memory safety bug in a PDF reader. When the program frees memory but later uses it without checking, an attacker can control what happens next, potentially running their own code. The attacker needs the victim to open a malicious PDF file or visit a malicious website.
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.