CVE-2009-3609: Integer Overflow
An integer overflow flaw exists in xpdf's ImageStream::ImageStream (Stream.cc) when calculating size of the imgLine buffer:
320 nVals = width nComps; 321 if (nBits == 1) { 322 imgLineSize = (nVals + 7) & ~7; 323 } else { 324 imgLineSize = nVals; 325 } 326 imgLine = (Guchar )gmallocn(imgLineSize, sizeof(Guchar));
width and nComps used go compute nVals value come from the input PDF file. Their multiplication may overflow / wrap, resulting in smaller imgLine buffer allocation than expected.
ImageStream always uses nVals as an upper bound when writing data into imgLine. Therefore, no buffer overflow occurs in ImageStream, but NULL pointer dereference may occur (gmallocn returns NULL when called with imgLineSize 0).
Pointer to imgLine is also returned out of ImageStream class instance from ImageStream::getLine() method. Callers of the method may later over-read allocated buffer, but no caller over-writing it was identified.
This code was introduced in xpdf in some early versions (exists in 0.9x), so is likely to appear in all applications embedding / forking xpdf.
Other sources
Integer overflow in the ImageStream::ImageStream function in Stream.cc in Xpdf before 3.02pl4 and Poppler before 0.12.1, as used in GPdf, kdegraphics KPDF, and CUPS pdftops, allows remote attackers to cause a denial of service (application crash) via a crafted PDF document that triggers a NULL pointer dereference or buffer over-read.
Affected Software
Remediation
Patch Available
Patch Available
Patch Available
Patch Available
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is the severity of CVE-2009-3609?
CVE-2009-3609 has been classified as a moderate severity vulnerability due to its potential to cause denial of service when processing specially crafted PDF documents.
How do I fix CVE-2009-3609?
To fix CVE-2009-3609, update your Xpdf to version 3.02pl4 or later, or Poppler to version 0.12.1 or later.
Which software is affected by CVE-2009-3609?
CVE-2009-3609 affects Xpdf versions prior to 3.02pl4, Poppler versions prior to 0.12.1, GPdf, kdegraphics KPDF, and CUPS pdftops.
What type of attack can exploit CVE-2009-3609?
CVE-2009-3609 can be exploited through a crafted PDF document that triggers an integer overflow, leading to an application crash.
What are the potential impacts of CVE-2009-3609?
The primary impact of CVE-2009-3609 is a denial of service, causing the affected application to crash when processing malicious PDF files.