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.
Originally disclosed on Cisco Talos
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.
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.