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

Poppler PDF Image Display DCTStream::readScan() Code Execution Vulnerability

A heap overflow in Poppler's DCTStream::readScan() occurs when a crafted PDF changes the image dimensions after the buffer has been allocated, causing out-of-bounds writes. An attacker could exploit this to corrupt heap memory and potentially execute code.

Marcin Noga Follow

Originally disclosed on Cisco Talos

High 7.5 View original

An exploitable heap overflow vulnerability exists in the image rendering functionality of Poppler-0.53.0. A specifically crafted pdf can cause an image resizing after allocation has already occurred, resulting in heap corruption which can lead to code execution.

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

The width and height used to allocate the image buffer are read from one header, but later headers can change these values, so the buffer size no longer matches the dimensions used in readScan().

Impact

A crafted PDF could cause heap corruption, potentially leading to code execution.

What the attacker needed

Victim opens a crafted PDF

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 bug is in a library that reads PDF files. When it processes an image, it first reserves some memory based on the image's size. But if the file later says the image is bigger, the program writes past the reserved memory, corrupting other data. An attacker could use this to run 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 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.