Foxit Reader signature field OnBlur event use-after-free vulnerability
A use-after-free vulnerability in Foxit Reader's handling of a signature field allows a malicious PDF with JavaScript to free a signature object and then use it, leading to memory corruption and potentially arbitrary code execution. An attacker must trick the user into opening the malicious file or visiting a malicious site if the browser plugin is enabled.
Originally disclosed on Cisco Talos
A use-after-free vulnerability exists in the way Foxit Reader 12.1.2.15356 handles a signature field. A specially crafted Javascript code inside a malicious PDF document can trigger reuse of a previously freed object, 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 signature object is freed by deletePages() but then used without validation, leading to a use-after-free.
Impact
This could lead to memory corruption and result in arbitrary code execution, but the attacker needs to trick the user into opening the malicious file or visiting a malicious site if the browser plugin is enabled.
What the attacker needed
Victim opens malicious PDF; or victim visits malicious site with plugin
How it was found
- Assign a callback to the OnBlur action of a signature field.
- Trigger the OnBlur action by calling setFocus on the signature field.
- In the callback, call deletePages() to free the signature object.
- The freed signature object is later used, 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 some memory but then keeps using it, like deleting a file and then trying to open it. Here, a malicious PDF uses JavaScript to delete a page (freeing a signature object) and then the program tries to use that object again, which can crash or let an attacker run their own code. The attacker needs the victim to open the PDF or visit a malicious site with the browser plugin enabled.
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.