Foxit Reader checkbox Calculate use-after-free vulnerability
Foxit Reader's JavaScript API for form fields frees a checkbox field object when a Calculate action calls deletePages, then later uses that freed object without validation. An attacker who gets a victim to open a crafted PDF could trigger memory corruption and potentially achieve arbitrary code execution.
A use-after-free vulnerability exists in the way Foxit Reader 2024.1.0.23997 handles a checkbox field 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
Impact
Could lead to memory corruption and arbitrary code execution if the user opens a malicious PDF, or visits a malicious site when the browser plugin is enabled.
What the attacker needed
Victim opens a malicious PDF; JavaScript enabled in the reader; or browser plugin enabled for web vector
How it was found
- Create a checkbox field via the JavaScript addField API.
- Assign a Calculate action to a text field that calls deletePages.
- Add a second field, which triggers the Calculate callback and frees the checkbox object.
- The freed checkbox object is then used, causing an access violation.
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 throws away an object in memory but keeps a pointer to it and later uses that pointer again. Here, a PDF's JavaScript deletes pages (which frees a form field) and then the reader still touches the freed field, which can crash or let an attacker control what happens next. The victim only has to open a malicious PDF.
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.