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:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-07 17:57:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
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 12:02:07 UTC
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 08:23:29 UTC
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 08:26:24 UTC
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 08:34:38 UTC
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 08:37:36 UTC
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 08:48:43 UTC
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 08:51:49 UTC
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 09:01:02 UTC
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 09:06:36 UTC
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-21 00:47:58 UTC
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-21 00:54:43 UTC
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 12:19:12 UTC
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 12:20:37 UTC
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 07:05:22 UTC
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 07:15:31 UTC
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 18:32:10 UTC
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-20 00:11:40 UTC
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-20 00:23:56 UTC
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-20 00:25:35 UTC
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 18:54:05 UTC
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 19:09:45 UTC
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 19:10:47 UTC
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 17:48:42 UTC
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