Foxit Reader Javascript annotation destruction use-after-free vulnerability
A use-after-free vulnerability in Foxit Reader's handling of annotation destruction allows an attacker to execute arbitrary code by tricking a user into opening a malicious PDF with JavaScript. The vulnerability occurs when a freed annotation object is reused without validation, leading to memory corruption.
Originally disclosed on Cisco Talos
A use-after-free vulnerability exists in the way Foxit Reader 12.1.2.15332 handles destroying annotations. 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 application fails to validate a pointer to an annotation object after it has been freed, leading to use-after-free.
Impact
An attacker could execute arbitrary code by exploiting this use-after-free, potentially leading to full system compromise.
What the attacker needed
Victim opens a malicious PDF; JavaScript enabled in Foxit Reader
The fix
The vulnerability was fixed by the vendor in version 12.1.2.15332? Actually, the report says patches were provided; the fix likely involves validating object pointers before use.
How it was found
- Create annotation objects in a PDF using JavaScript.
- Assign a callback function to a form field's OnBlur action that destroys an annotation.
- Trigger the callback by setting focus to the form field.
- The callback destroys an annotation, freeing associated objects.
- Later, the freed object is accessed 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 an object but later uses it again 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.
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.