Skip to content
Memory corruption Advisory Advanced CVE-2019-5066

Aspose.PDF for C++ LZWDecode filter predictor remote code execution vulnerability

A malformed Predictor value in an LZWDecode filter causes a use-after-free of an LZW stream object. An attacker could exploit this to corrupt memory and potentially execute arbitrary code.

Aleksandar Nikolic Cisco Talos Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

An exploitable use-after-free vulnerability exists in the way LZW-compressed streams are processed in Aspose.PDF 19.2.for C++. A specially crafted PDF can cause a dangling heap pointer, resulting in a use-after-free condition.

Aleksandar Nikolic Cisco Talos, 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 LZW decoder does not validate that the Predictor value is positive, so a negative value causes the LZW object to be freed while a stale reference remains.

Impact

An attacker could control allocations after the free to place arbitrary objects in its place, leading to further memory corruption and potentially arbitrary code execution.

What the attacker needed

Victim processes a crafted PDF; Aspose.PDF 19.2 for C++

The fix

The vendor patched the issue, likely by validating that the Predictor value is positive before using it.

How it was found

  1. Create a PDF object with an LZWDecode filter and a DecodeParms dictionary containing a negative Predictor value.
  2. Process the crafted PDF with the vulnerable Aspose.PDF library.
  3. The LZW object is allocated and then freed due to the malformed Predictor.
  4. A stale reference to the freed object is used during further processing, causing a use-after-free.

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 compressed data, and the program uses a decoder to unpack it. A negative number in a setting called Predictor makes the program free an object but still keep a pointer to it. Later, the program uses that pointer, which now points to freed memory, and this can crash or be abused to run attacker 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 Aleksandar Nikolic Cisco Talos

View all

1 more disclosed report, 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.