Skip to content
Memory corruption Advisory Advanced CVE-2025-58085

Foxit Reader Barcode Calculate CPDF_FormField Use-After-Free Vulnerability

A use-after-free flaw exists in how Foxit Reader handles a Barcode form field when JavaScript triggers a Calculate action that deletes the page. An attacker could corrupt memory and potentially achieve arbitrary code execution by getting a user to open 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 handles a Barcode field object. A specially crafted JavaScript code inside a malicious PDF document can trigger this vulnerability, 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 Calculate action callback frees the page's form field objects via deletePages(), and the freed CPDF_FormField object is later dereferenced without any validation.

Impact

Depending on the memory layout, this could allow arbitrary read and write operations and ultimately arbitrary code execution, though the text only says it may be possible.

What the attacker needed

Victim opens a malicious PDF; JavaScript enabled in the reader; or victim visits a malicious site with plugin

The fix

The vendor released a patch on 2025-12-19.

How it was found

  1. Assign a Calculate action callback to a Barcode form field.
  2. Trigger the callback by calling getField on that field.
  3. In the callback, delete the page, which frees the form field object.
  4. The freed object is then dereferenced, 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, one of those programs deletes a page while the reader is still using information about a form field on that page, so the reader later reads memory that has already been handed back. That kind of mistake can let an attacker control what the program does next, potentially running their own code.

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.