Bug 526893 (CVE-2009-3609)

Summary: CVE-2009-3609 xpdf/poppler: ImageStream::ImageStream integer overflow
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: aalam, jlieskov, jnovy, jrb, kreilly, mkasik, rdieter, tcallawa, than, twaugh
Target Milestone: ---Keywords: Reopened, Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=low,source=redhat,reported=20090603,public=20091014,cvss2=2.1/AV:L/AC:L/Au:N/C:N/I:N/A:P,cwe=CWE-190[auto]
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-07 13:57:08 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 527399, 527400, 527403, 527404, 527413, 527414, 527454, 527455, 527456, 527457, 527468, 527469, 527470, 530890, 577309, 577322, 577323, 577328, 577329, 639837, 639838, 833916    
Bug Blocks:    

Description Tomas Hoger 2009-10-02 08:02:07 EDT
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.
Comment 1 Tomas Hoger 2009-10-06 04:23:29 EDT
Upstream patch for this is attached here as part of pl4 patch:
  https://bugzilla.redhat.com/show_bug.cgi?id=526637#c6
Comment 18 errata-xmlrpc 2009-10-15 04:26:24 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2009:1502 https://rhn.redhat.com/errata/RHSA-2009-1502.html
Comment 19 errata-xmlrpc 2009-10-15 04:34:38 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2009:1501 https://rhn.redhat.com/errata/RHSA-2009-1501.html
Comment 20 errata-xmlrpc 2009-10-15 04:37:36 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 3

Via RHSA-2009:1500 https://rhn.redhat.com/errata/RHSA-2009-1500.html
Comment 21 errata-xmlrpc 2009-10-15 04:48:43 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2009:1503 https://rhn.redhat.com/errata/RHSA-2009-1503.html
Comment 22 errata-xmlrpc 2009-10-15 04:51:49 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2009:1504 https://rhn.redhat.com/errata/RHSA-2009-1504.html
Comment 23 errata-xmlrpc 2009-10-15 05:01:02 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2009:1513 https://rhn.redhat.com/errata/RHSA-2009-1513.html
Comment 24 errata-xmlrpc 2009-10-15 05:06:36 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2009:1512 https://rhn.redhat.com/errata/RHSA-2009-1512.html
Comment 25 Fedora Update System 2009-10-20 20:47:58 EDT
xpdf-3.02-15.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 26 Fedora Update System 2009-10-20 20:54:43 EDT
xpdf-3.02-15.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 28 Fedora Update System 2009-10-26 08:19:12 EDT
poppler-0.8.7-7.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/poppler-0.8.7-7.fc10
Comment 29 Fedora Update System 2009-10-26 08:20:37 EDT
poppler-0.10.7-3.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/poppler-0.10.7-3.fc11
Comment 30 Fedora Update System 2009-10-27 03:05:22 EDT
poppler-0.8.7-7.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 31 Fedora Update System 2009-10-27 03:15:31 EDT
poppler-0.10.7-3.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 32 Fedora Update System 2009-11-06 13:32:10 EST
xpdf-3.02-15.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 33 Fedora Update System 2010-02-19 19:11:40 EST
pdfedit-0.4.3-4.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 34 Fedora Update System 2010-02-19 19:23:56 EST
pdfedit-0.4.3-4.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 35 Fedora Update System 2010-02-19 19:25:35 EST
pdfedit-0.4.3-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 41 errata-xmlrpc 2010-05-06 14:54:05 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2010:0399 https://rhn.redhat.com/errata/RHSA-2010-0399.html
Comment 42 errata-xmlrpc 2010-05-06 15:09:45 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2010:0400 https://rhn.redhat.com/errata/RHSA-2010-0400.html
Comment 43 errata-xmlrpc 2010-05-06 15:10:47 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 3

Via RHSA-2010:0401 https://rhn.redhat.com/errata/RHSA-2010-0401.html
Comment 45 errata-xmlrpc 2010-10-07 13:48:42 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2010:0755 https://rhn.redhat.com/errata/RHSA-2010-0755.html