Skip to content
Memory corruption Advisory Advanced CVE-2024-25648

Foxit Reader ComboBox widget Format event use-after-free vulnerability

Foxit Reader mishandles a ComboBox widget when JavaScript attached to its Format event deletes the pages that own the widget, leaving a freed object that is later used. An attacker could corrupt memory and potentially execute arbitrary code if a victim opens a malicious PDF.

KPC Follow

Originally disclosed on Cisco Talos

High 8.8 View original

A use-after-free vulnerability exists in the way Foxit Reader 2024.1.0.23997 handles a ComboBox widget. A specially crafted JavaScript code inside a malicious PDF document can trigger reuse of a previously freed object, which can lead to memory corruption and result in arbitrary code execution.

KPC, 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 Format event callback frees the ComboBox widget via deletePages(), and the code then dereferences the stale widget pointer without checking whether it is still valid.

Impact

This could lead to memory corruption and arbitrary code execution, though the text only demonstrates a crash in the debugger.

What the attacker needed

Victim opens a malicious PDF; JavaScript enabled in the reader; or browser plugin enabled for web vector

The fix

The vendor provided updated versions that address the issue.

How it was found

  1. Create a ComboBox field in the active document.
  2. Assign a Format action to the field that calls deletePages twice.
  3. Add the ComboBox field again, which triggers the Format callback.
  4. The second deletePages call frees the widget object.
  5. The freed widget is then used, causing a crash.

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 can contain small programs (JavaScript) that run when the file is opened. Here the program creates a form dropdown, tells it to run code when its value is formatted, and that code deletes the pages, which destroys the dropdown. The reader keeps using the destroyed dropdown as if it still existed, and that kind of mistake can let an attacker take over the program.

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 KPC

View all

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