Foxit Reader Checkbox Calculate CBF_Widget Use-After-Free Vulnerability
A use-after-free vulnerability in Foxit Reader's handling of checkbox objects allows a malicious PDF with JavaScript to free a CBF_Widget object and then use it, leading to memory corruption and potential arbitrary code execution. An attacker could exploit this by tricking a user into opening a crafted PDF or visiting a malicious site if the browser plugin is enabled.
A use-after-free vulnerability exists in the way Foxit Reader 2024.3.0.26795 handles a checkbox CBFWidget 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
The checkbox object is freed by deletePages() and then used without validation.
Impact
This could lead to memory corruption and potentially arbitrary code execution, but the attacker must first trick the user into opening a malicious file or visiting a malicious site.
What the attacker needed
Victim opens malicious PDF; or visits malicious site with plugin
How it was found
- Create a checkbox field using addField.
- Assign a Calculate action to a text field that calls deletePages twice.
- Trigger the Calculate action by adding another checkbox field.
- The deletePages call frees the checkbox object.
- The freed object is later 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.
A use-after-free bug happens when a program frees memory but then keeps using it, like deleting a file and then trying to open it. In this case, Foxit Reader frees a checkbox object when a page is deleted, but then still tries to use that object, which can crash the program or let an attacker run their own code. The attacker needs to convince someone to open a malicious 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.