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

Foxit PDF Reader JavaScript Field object signatureInfo 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 occurs when a document is closed but JavaScript continues to access a stale reference to a SignatureInfo object.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

High 8.0 View original

An exploitable use-after-free vulnerability exists in the JavaScript engine of Foxit Software’s PDF Reader, version 9.2.0.9297. 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 JavaScript engine allows a document to be closed while JavaScript continues to execute, and accessing a stale reference to a freed SignatureInfo object leads to a use-after-free condition.

Impact

An attacker could execute arbitrary code on the victim's machine by tricking them into opening a malicious PDF or visiting a malicious site if the browser plugin is enabled.

What the attacker needed

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

The fix

The vulnerability was fixed by the vendor in version 9.2.0.9297 (patched on 2018-09-28).

How it was found

  1. Create a PDF with JavaScript that saves a reference to a SignatureInfo object via a form field's signatureInfo method.
  2. Close the document using closeDoc, which frees the object.
  3. Access a property of the stale reference (e.g., docValidity) to trigger the use-after-free.
  4. Spray memory with typed arrays to control the freed object's contents.
  5. Manipulate memory layout to achieve arbitrary code execution.

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: the program frees memory but keeps using it. An attacker can craft a PDF that closes itself while JavaScript still holds a reference to an object, then manipulate that freed memory to run their own code. The victim just needs to open the PDF or visit a malicious site if the browser plugin is 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.

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.