Skip to content
Memory corruption Advisory Advanced CVE-2020-13548

Foxit Reader Javascript Field fileSelect Use After Free Vulnerability

A use-after-free vulnerability in Foxit Reader's JavaScript engine allows a specially crafted PDF to trigger reuse of freed memory, potentially leading to arbitrary code execution. An attacker can exploit this by tricking a user into opening a malicious PDF or visiting a malicious site if the browser plugin is enabled.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

High 8.0 View original

A use after free vulnerability exists in the JavaScript engine of Foxit Software’s Foxit PDF Reader, version 10.1.0.37527. A specially crafted PDF document can trigger reuse of previously free memory which can lead to arbitrary code execution.

Aleksandar Nikolic, on Cisco Talos

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 JavaScript engine frees objects associated with a form field when the field is removed, but later code still tries to use those freed objects, leading to a use-after-free.

Impact

This could lead to arbitrary code execution, allowing an attacker to take control of the affected system.

What the attacker needed

Victim opens malicious PDF; or victim visits malicious site with plugin

How it was found

  1. Create a PDF with two text fields, txt1 and txt2.
  2. Set txt2's defaultValue, focus it, set fileSelect to 1, and set a Validate action that calls a function f.
  3. Shift focus from txt2 to txt1 to trigger the Validate event.
  4. In function f, focus txt2, then txt1, then remove the field txt2 (using removeField with an empty string).
  5. The removal frees objects still in use, causing a crash that can be exploited.

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 is a use-after-free bug in a PDF reader. When a PDF contains JavaScript that removes a form field, the program still tries to use the memory that was freed, which can let an attacker run their own code. The attacker needs the victim to open a malicious PDF or visit a malicious website.

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.

More by Aleksandar Nikolic

View all

147 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.