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

Foxit Reader Javascript exportDataObject HTA file creation vulnerability

Foxit Reader's JavaScript exportDataObject method fails to validate file extensions and directory traversal, allowing an attacker to create an HTA file in the Windows Startup folder. This leads to arbitrary code execution when the file is launched or on next login.

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 a failure to properly validate a dangerous extension. 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

Root cause

Likely the application uses a blocklist that includes 'hta ' with a trailing space instead of 'hta', and it fails to sanitise directory traversal sequences in the filename before writing the file.

Impact

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

What the attacker needed

Victim opens malicious PDF; or victim visits malicious site with plugin

The fix

The application should properly filter dangerous extensions (e.g., block 'hta' without trailing space) and sanitise directory traversal sequences in filenames.

How it was found

  1. Create a PDF with a JavaScript action that calls exportDataObject with a data object name and launch flag set to 2.
  2. Embed a file with subtype application/hta containing malicious script.
  3. Define a filespec with a UF key that uses directory traversal to point to the Startup folder and ends with .hta.
  4. Name the data object to match the embedded file.
  5. Open the PDF in Foxit Reader; the script extracts the HTA file to the Startup folder.
  6. The HTA file executes on next login or when launched, running arbitrary code.

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.

Foxit Reader is a program for opening PDF files. It lets PDFs run small scripts, and one script command can save an embedded file to disk. The program meant to block dangerous file types like .hta, but it made a mistake and let .hta through, and it also allowed the script to choose a folder outside the temporary directory. So a malicious PDF could drop a file that runs code when the computer starts.

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.