Skip to content
Memory corruption Advisory Advanced CVE-2021-21796

Nitro Pro PDF JavaScript local_file_path Object use-after-free vulnerability

A use-after-free exists in Nitro Pro's JavaScript implementation: a crafted PDF can cause the object holding a temporary document path to be destroyed and then reused. An attacker who convinces a user to open such a document could potentially execute code in the context of the application.

A member Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable use-after-free vulnerability exists in the JavaScript implementation of Nitro Pro PDF. A specially crafted document can cause an object containing the path to a document to be destroyed and then later reused, resulting in a use-after-free vulnerability, which can lead to code execution under the context…

a member, 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 temporary local_file_path object created for a document with no associated file is destroyed by an exception handler and then reused later in the same function.

Impact

This could lead to code execution under the context of the application, though the text only demonstrates the memory corruption and does not show a working exploit.

What the attacker needed

Victim opens a crafted PDF; JavaScript enabled in the PDF reader

How it was found

  1. Open a crafted PDF in Nitro Pro so its embedded JavaScript runs.
  2. Call the app.newDoc function to create a new document with no associated file.
  3. The application generates a temporary filename into a local_file_path object.
  4. The exception handler destroys that object, and later code reuses the freed memory.

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 is a memory bug where a program frees a chunk of memory but keeps using it, so an attacker can sometimes control what lands there. Here a PDF's built-in JavaScript creates a new document, and the code that builds a temporary file path for it frees that path object too early and then touches it again. If an attacker can shape that reused memory, they may be able to run their own code as the PDF reader.

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 A member

View all

110 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.