Skip to content
Path traversal Advisory Intermediate CVE-2023-40194

Foxit Reader Javascript exportDataObject arbitrary file creation vulnerability

Foxit Reader's exportDataObject JavaScript method fails to sanitise directory traversal sequences and file extensions, allowing a malicious PDF to write arbitrary files to any location. An attacker could then execute code by placing a malicious file in a startup folder.

Kamlapati Choubey Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An arbitrary file creation vulnerability exists in the Javascript exportDataObject API of Foxit Reader 12.1.3.15356 due to mistreatment of whitespace characters. A specially crafted malicious file can create files at arbitrary locations, which can lead to arbitrary code execution.

Kamlapati Choubey, 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

Impact

An attacker could create arbitrary files and potentially execute arbitrary code by placing a malicious file in a startup location.

What the attacker needed

Victim opens malicious PDF; Foxit Reader installed

How it was found

  1. Create a PDF with JavaScript that calls exportDataObject with a crafted cName and nLaunch set to 2.
  2. Embed a file object containing malicious script (e.g., VBScript) and set its UF key to a path with directory traversal and a space after the extension.
  3. Open the PDF in Foxit Reader; the JavaScript extracts the embedded file to the specified path.
  4. The file is created at the arbitrary location (e.g., Startup folder) and may be launched if nLaunch is 2.

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 PDF file can contain JavaScript that runs when you open it. Foxit Reader has a feature that lets this JavaScript save an embedded file to your computer, but it doesn't properly check where the file is saved or what type it is. An attacker can abuse this to save a harmful file in a place that runs automatically, like the Windows Startup folder, so the next time you log in, their code runs.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Kamlapati Choubey

View all

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

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.