Skip to content
Memory corruption Advisory Advanced CVE-2017-2822

Lexmark LibISYSpdf Image Rendering DCTStream::getBlock() Code Execution Vulnerability

A crafted PDF can cause a stack-based buffer overflow in Lexmark Perceptive Document Filters' PDF rendering library, leading to code execution. The vulnerability arises from a corrupted DCTStream object whose buffer pointers are user-controlled, allowing an oversized memcpy to the stack.

Marcin Noga Follow

Originally disclosed on Cisco Talos

High 7.5 View original

An exploitable code execution vulnerability exists in the image rendering functionality of Lexmark Perceptive Document Filters 11.3.0.2400. A specifically crafted PDF can cause a function call on a corrupted DCTStream to occur, resulting in user controlled data being written to the stack.

Marcin Noga and Lilith Wyatt, 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 IGRStream class fails to properly initialise and validate its internal buffer pointers when the image type is switched after allocation, leading to an integer underflow in the size calculation for a memcpy into a fixed-size stack buffer.

Impact

A remote attacker could execute arbitrary code by convincing a victim to open a malicious PDF, though the CVSS vector indicates high attack complexity and user interaction.

What the attacker needed

Victim opens a crafted PDF; heap manipulation

How it was found

  1. Craft a PDF that sets the image type to progressive initially and then switches to interleaved after memory allocation.
  2. Manipulate the heap so that the blockBuf and blockBufEnd pointers in the IGRStream object are controlled by the user.
  3. Trigger the parsing of the crafted PDF, causing the corrupted IGRStream to be used in a font dictionary lookup.
  4. The DCTStream::getBlock function is called, which performs a memcpy with user-controlled source, size, and a stack destination.
  5. The size calculation underflows, bypassing the cmovg check and causing a stack-based buffer overflow.

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.

This report describes a memory corruption bug in a PDF rendering library. When a specially crafted PDF is opened, the software copies too much data onto a small stack buffer, which can overwrite important control data and let an attacker run their own code. The flaw is in how the library handles certain image types inside the PDF.

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 Marcin Noga

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.