Skip to content
Memory corruption Advisory Advanced CVE-2018-3850

Foxit PDF Reader JavaScript XFA Clone Remote Code Execution Vulnerability

A use-after-free vulnerability in Foxit PDF Reader's JavaScript engine allows an attacker to execute arbitrary code by tricking a user into opening a malicious PDF. The flaw is triggered when JavaScript closes the active document and then calls a specific XFA method, leading to reuse of freed memory.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable use-after-free vulnerability exists in the JavaScript engine Foxit Software Foxit PDF Reader version 9.0.1.1049. A specially crafted PDF document can trigger a previously freed object in memory to be reused, resulting in 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 XFA clone method keeps a reference to an object that is freed when the document is closed, leading to a use-after-free.

Impact

An attacker could execute arbitrary code on the victim's machine, but the victim must open a malicious PDF or visit a malicious site if a browser plugin is enabled.

What the attacker needed

Victim opens malicious PDF; or visits malicious site with plugin

The fix

The vulnerability was fixed in a vendor patch released on 2018-04-19.

How it was found

  1. Create a PDF document containing JavaScript that closes the active document and then calls the XFA clone method.
  2. Open the PDF in Foxit Reader with PageHeap enabled.
  3. Observe the crash indicating a use-after-free.

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 memory corruption bug in a PDF reader. When a PDF contains JavaScript that closes the document and then calls a certain function, the program tries to use memory that has already been freed. An attacker can control that memory to run their own code, but the victim must 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.

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.