Foxit Reader List Box Calculate Array Use-After-Free Vulnerability
Foxit Reader's handling of an Array object assigned to a list box field can leave a dangling pointer after the JavaScript API deletePages() frees the page's objects. A crafted PDF with embedded JavaScript can then dereference the freed object, causing memory corruption that may lead to arbitrary code execution.
A use-after-free vulnerability exists in the way Foxit Reader handles an Array object. A specially crafted JavaScript code inside a malicious PDF document can trigger this vulnerability, which can lead to memory corruption and 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 reader frees objects tied to a page when deletePages() runs but later dereferences a previously assigned Array object without checking whether it is still valid.
Impact
Depending on the memory layout, this could allow arbitrary read and write operations and ultimately arbitrary code execution, though the text only says it 'may be possible'.
What the attacker needed
Victim opens a malicious PDF; JavaScript enabled in the reader
The fix
The vendor released a patch on 2026-03-31.
How it was found
- Assign a callback to the Calculate event of a text field, which fires immediately.
- In the callback, call deletePages() so the page's objects, including the array, are freed.
- Assign a new Array to the list box field's value.
- Open the crafted PDF in Foxit Reader to trigger the crash when the freed object is dereferenced.
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 programs (JavaScript) that run when the file is opened. This report shows that one of those programs can tell the reader to delete pages, which throws away some memory, and then the reader keeps using that thrown-away memory as if it were still valid. That mistake can crash the program or, in the worst case, let an attacker run their own code 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.