CVE Vulnerabilities

CVE-2007-3387

Integer Overflow or Wraparound

Published: Jul 30, 2007 | Modified: Feb 13, 2023
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
6.8 MEDIUM
AV:N/AC:M/Au:N/C:P/I:P/A:P
RedHat/V2
RedHat/V3
Ubuntu
UNTRIAGED

Integer overflow in the StreamPredictor::StreamPredictor function in xpdf 3.02, as used in (1) poppler before 0.5.91, (2) gpdf before 2.8.2, (3) kpdf, (4) kdegraphics, (5) CUPS, (6) PDFedit, and other products, might allow remote attackers to execute arbitrary code via a crafted PDF file that triggers a stack-based buffer overflow in the StreamPredictor::getNextLine function.

Weakness

The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.

Affected Software

Name Vendor Start Version End Version
Cups Apple * 1.3.11 (including)
Poppler Freedesktop * 0.5.91 (excluding)
Gpdf Gpdf_project * 2.8.2 (excluding)
Xpdf Xpdfreader 3.02 (including) 3.02 (including)
Red Hat Enterprise Linux 2.1 RedHat tetex-0:1.0.7-38.5E.11 *
Red Hat Enterprise Linux 2.1 RedHat xpdf-1:0.92-18.RHEL2 *
Red Hat Enterprise Linux 3 RedHat cups-1:1.1.17-13.3.45 *
Red Hat Enterprise Linux 3 RedHat tetex-0:1.0.7-67.10 *
Red Hat Enterprise Linux 3 RedHat xpdf-1:2.02-10.RHEL3 *
Red Hat Enterprise Linux 4 RedHat cups-1:1.1.22-0.rc1.9.20.2 *
Red Hat Enterprise Linux 4 RedHat kdegraphics-7:3.3.1-4.RHEL4 *
Red Hat Enterprise Linux 4 RedHat gpdf-0:2.8.2-7.7 *
Red Hat Enterprise Linux 4 RedHat tetex-0:2.0.2-22.0.1.EL4.8 *
Red Hat Enterprise Linux 4 RedHat xpdf-1:3.00-12.RHEL4 *
Red Hat Enterprise Linux 5 RedHat cups-1:1.2.4-11.5.3.el5 *
Red Hat Enterprise Linux 5 RedHat kdegraphics-7:3.5.4-2.el5 *
Red Hat Enterprise Linux 5 RedHat tetex-0:3.0-33.1.el5 *
Red Hat Enterprise Linux 5 RedHat poppler-0:0.5.4-4.1.el5 *
Koffice Ubuntu dapper *
Koffice Ubuntu devel *
Koffice Ubuntu edgy *
Koffice Ubuntu feisty *
Koffice Ubuntu gutsy *
Koffice Ubuntu hardy *
Koffice Ubuntu intrepid *
Koffice Ubuntu jaunty *
Koffice Ubuntu karmic *
Poppler Ubuntu dapper *
Poppler Ubuntu devel *
Poppler Ubuntu edgy *
Poppler Ubuntu feisty *
Poppler Ubuntu gutsy *
Poppler Ubuntu hardy *
Poppler Ubuntu intrepid *
Poppler Ubuntu jaunty *
Poppler Ubuntu karmic *
Xpdf Ubuntu dapper *
Xpdf Ubuntu devel *
Xpdf Ubuntu edgy *
Xpdf Ubuntu feisty *
Xpdf Ubuntu gutsy *
Xpdf Ubuntu hardy *
Xpdf Ubuntu intrepid *
Xpdf Ubuntu jaunty *
Xpdf Ubuntu karmic *

Potential Mitigations

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
  • If possible, choose a language or compiler that performs automatic bounds checking.
  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
  • Use libraries or frameworks that make it easier to handle numbers without unexpected consequences.
  • Examples include safe integer handling packages such as SafeInt (C++) or IntegerLib (C or C++). [REF-106]
  • Perform input validation on any numeric input by ensuring that it is within the expected range. Enforce that the input meets both the minimum and maximum requirements for the expected range.
  • Use unsigned integers where possible. This makes it easier to perform validation for integer overflows. When signed integers are required, ensure that the range check includes minimum values as well as maximum values.
  • Understand the programming language’s underlying representation and how it interacts with numeric calculation (CWE-681). Pay close attention to byte size discrepancies, precision, signed/unsigned distinctions, truncation, conversion and casting between types, “not-a-number” calculations, and how the language handles numbers that are too large or too small for its underlying representation. [REF-7]
  • Also be careful to account for 32-bit, 64-bit, and other potential differences that may affect the numeric representation.

References