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

Foxit Reader JavaScript choice field format event use-after-free vulnerability

A use-after-free flaw in Foxit Reader's JavaScript engine can be triggered by a crafted PDF that manipulates form field focus and removal during a Format event. An attacker could exploit this to cause memory corruption and potentially achieve arbitrary code execution.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

High 8.8 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

Likely the event handler code does not account for the field being removed during the Format event, so it later accesses the freed object.

Impact

This could lead to further memory corruption or arbitrary code execution, and if the browser plugin is enabled, visiting a malicious site can also trigger the vulnerability.

What the attacker needed

Victim opens a malicious PDF; or visits a malicious site if plugin enabled

How it was found

  1. Set a Format event handler on a choice field to call a function.
  2. Trigger the Format event by moving focus between two fields.
  3. In the handler, remove the field, freeing its memory.
  4. Continue execution, causing a crash when the freed memory is reused.

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 frees memory but then keeps using it, like deleting a file and still trying to open it. Here, a malicious PDF uses JavaScript to remove a form field while it is still being processed, so the program later reads freed memory. This can crash the reader or let an attacker run their own code.

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.