Skip Navigation

  • Home
  • Contact us
  • FAQ
  • Glossary
  • Public key
  • Sitemap
  • Cymraeg
  • What's new
CPNI - Centre for the Protection of National Infastructure

Advanced search

  • About CPNI
  • The threats
  • Security planning
  • Methods of attack
  • Protecting your assets
  • Products and services
    • CSIRTUK advisories
      • Advisories archive
    • General protective security publications
    • InfoSec briefings
    • InfoSec technical notes
    • InfoSec vulnerability disclosures
    • Good practice guidelines
    • Viewpoints
    • Information exchanges
    • Risk Management Delivery Group
  • Research
Home > Products and services > CSIRTUK advisories > Advisories archive > December 2005 > iDefense - xpdf vulnerabilities

December 2005

iDefense - xpdf vulnerabilities

ID: 01078
Ref: 1012/2005
Date: 07 December 2005:21:33:35
Version: 1

Title: iDefense - xpdf vulnerabilities
Abstract: Details of a number of vulnerabilities in xpdf - an open-source viewer for Portable Document Format (PDF) files

Multiple Vendor xpdf DCTStream Baseline Heap Overflow Vulnerability

iDefense Security Advisory 12.05.05
www.idefense.com/application/poi/display?id=342&type=vulnerabilities
December 5, 2005

I. BACKGROUND

Xpdf is an open-source viewer for Portable Document Format (PDF) files.

II. DESCRIPTION

Local exploitation of a heap-based buffer overflow vulnerability in
xpdf, as included in various vendors' operating system distributions,
could allow attackers to cause a denial of service condition,
potentially resulting in arbitrary code execution.

The vulnerability specifically exists due to insufficient input
validation in the DCT stream parsing code. The
DCTStream::readBaselineSOF function from xpdf/Stream.cc takes the value
of numComps from user-controllable data from within the PDF file. The
numComps value is used in a loop to copy data from the file into a pre-
allocated buffer in the heap, shown as follows:

GBool DCTStream::readBaselineSOF() {
...
numComps = str->getChar();
...
for (i = 0; i < numComps; ++i) {
compInfo[i].id = str->getChar();
c = str->getChar();
compInfo[i].hSample = (c >> 4) & 0x0f;
compInfo[i].vSample = c & 0x0f;
compInfo[i].quantTable = str->getChar();
}
...

Overly large values supplied to numComps will result in corruption of
heap memory resulting in a DoS condition, potentially resulting in
arbitrary code execution.

III. ANALYSIS

Successful exploitation of this vulnerability can result in arbitrary
code execution with privileges of the xpdf process. Currently,
exploitation resulting in code execution is theoretical and dependant
on the process memory layout. A typical exploitation attempt would
require an attacker to supply a malicious .pdf to the victim. The
victim would need to open the corrupt .pdf file in xpdf, triggering the
vulnerability.

IV. DETECTION

iDefense has confirmed the existence of this vulnerability in xpdf
3.01. All earlier versions of xpdf are suspected vulnerable.

The following vendors include susceptible xpdf packages within their
operating system distributions:

. The Debian Project: Linux 3.0 and 3.1

V. WORKAROUND

iDefense is currently unaware of any effective workarounds for this
vulnerability.

VI. VENDOR RESPONSE

A patch for this vulnerability is available at:

ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.01pl1.patch

Updated binaries (version 3.01pl1) are available at:

http://www.foolabs.com/xpdf/download.html

VII. CVE INFORMATION

The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CAN-2005-3191 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.

VIII. DISCLOSURE TIMELINE

10/13/2005 Initial vendor notification
10/19/2005 Initial vendor response
12/05/2005 Coordinated public disclosure

IX. CREDIT

iDefense credits infamous41md@hotpop.com with the discovery of this
vulnerability.

Get paid for vulnerability research
http://www.iDefense.com/poi/teams/vcp.jsp

Free tools, research and upcoming events
http://labs.iDefense.com

X. LEGAL NOTICES

Copyright C 2005 iDefense, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@iDefense.com for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.

*******************************************************************

Multiple Vendor xpdf DCTStream Progressive Heap Overflow

iDefense Security Advisory 12.05.05
www.idefense.com/application/poi/display?id=343&type=vulnerabilities
December 5, 2005

I. BACKGROUND

Xpdf is an open-source viewer for Portable Document Format (PDF) files.

II. DESCRIPTION

Local exploitation of a heap-based buffer overflow vulnerability in
xpdf, as included by multiple vendor's software distributions, could
allow attackers to cause a denial of service (DoS) condition,
potentially resulting in arbitrary code execution.

The vulnerability specifically exists due to insufficient input
validation in the DCT stream parsing code. The
DCTStream::readProgressiveSOF function from xpdf/Stream.cc takes the
value of numComps from user-controllable data from within the PDF file.
The numComps value is used in a loop to copy data from the file into a
pre-allocated buffer in the heap as shown below.

GBool DCTStream::readProgressiveSOF() {
...
numComps = str->getChar();
...
for (i = 0; i < numComps; ++i) {
compInfo[i].id = str->getChar();
c = str->getChar();
compInfo[i].hSample = (c >> 4) & 0x0f;
compInfo[i].vSample = c & 0x0f;
compInfo[i].quantTable = str->getChar();
}
...

Overly large values supplied to numComps result in corruption of heap
memory, resulting in a DoS condition, potentially resulting in
arbitrary code execution.

III. ANALYSIS

Exploitation could result in arbitrary code execution with privileges
of the xpdf process. Currently, exploitation resulting in code
execution is theoretical and dependant on the process memory layout. A
typical exploitation attempt would require an attacker to supply a
malicious pdf to the victim. The victim would need to open the corrupt
pdf file in xpdf, and at this point the vulnerability would be
triggered.

IV. DETECTION

iDefense has confirmed the existence of this vulnerability in xpdf
3.01. All earlier versions of xpdf are suspected vulnerable.

The following vendors include susceptible xpdf packages within their
operating system distributions:

. The Debian Project: Linux 3.0 and 3.1

V. WORKAROUND

iDefense is currently unaware of any effective workarounds for this
vulnerability.

VI. VENDOR RESPONSE

A patch for this vulnerability is available at:

ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.01pl1.patch

Updated binaries (version 3.01pl1) are available at:

http://www.foolabs.com/xpdf/download.html

VII. CVE INFORMATION

The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CAN-2005-3191 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.

VIII. DISCLOSURE TIMELINE

10/13/2005 Initial vendor notification
10/19/2005 Initial vendor response
12/05/2005 Coordinated public disclosure

IX. CREDIT

iDefense credits infamous41md@hotpop.com with the discovery of this
vulnerability.

Get paid for vulnerability research
http://www.iDefense.com/poi/teams/vcp.jsp

Free tools, research and upcoming events
http://labs.iDefense.com

X. LEGAL NOTICES

Copyright C 2005 iDefense, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@iDefense.com for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.

*******************************************************************

Multiple Vendor xpdf JPX Stream Reader Heap Overflow Vulnerability

iDefense Security Advisory 12.05.05
www.idefense.com/application/poi/display?id=345&type=vulnerabilities
December 5, 2005

I. BACKGROUND

Xpdf is an open-source viewer for Portable Document Format (PDF) files.

II. DESCRIPTION

Local exploitation of a heap-based buffer overflow vulnerability in
xpdf, as included by multiple vendor's software distributions, could
allow attackers to cause a denial of service (DoS) condition,
potentially resulting in arbitrary code execution.

The vulnerability specifically exists due to insufficient input
validation in the JPX Stream parsing code for decoding embedded JPEG
2000 images. The JPXStream::readCodestream function from
xpdf/JPXStream.cc takes the value of nXTiles and nYTiles from user-
controllable data from within the PDF file. The nXTiles and nYTiles
values are then used in a gmallocn() call as shown below.

GBool JPXStream::readCodestream(Guint len) {
...
switch (segType) {
case 0x4f: // SOC - start of codestream
// marker only
break;
case 0x51: // SIZ - image and tile size
if (!readUWord(&capabilities) ||
!readULong(&img.xSize) ||
!readULong(&img.ySize) ||
!readULong(&img.xOffset) ||
!readULong(&img.yOffset) ||
!readULong(&img.xTileSize) ||
!readULong(&img.yTileSize) ||
!readULong(&img.xTileOffset) ||
!readULong(&img.yTileOffset) ||
!readUWord(&img.nComps)) {
error(getPos(), "Error in JPX SIZ marker segment");
return gFalse;
}
...
img.nXTiles = (img.xSize - img.xTileOffset + img.xTileSize - 1) /
img.xTileSize;
img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1) /
img.yTileSize;

img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
sizeof(JPXTile));

The values are used again later in JPEG format parsing code to copy
data from the file into a pre-allocated buffer in the heap. Overly
large values supplied to nXTiles and nYTiles result in corruption of
heap memory, which results in a DoS condition. This could result in
arbitrary code execution.

III. ANALYSIS

Exploitation could result in arbitrary code execution with privileges
of the xpdf process. Currently, exploitation resulting in code
execution is theoretical and dependant on the process memory layout. A
typical exploitation attempt would require an attacker to supply a
malicious pdf to the victim. The victim would need to open the corrupt
pdf file in xpdf. Only then would the vulnerability be triggered.

IV. DETECTION

iDefense has confirmed the existence of this vulnerability in xpdf
3.01. All earlier versions of xpdf are suspected vulnerable.

The following vendors include susceptible xpdf packages within their
operating system distributions:

. The Debian Project: Linux 3.0 and 3.1

V. WORKAROUND

iDefense is currently unaware of any effective workarounds for this
vulnerability.

VI. VENDOR RESPONSE

A patch for this vulnerability is available at:

ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.01pl1.patch

Updated binaries (version 3.01pl1) are available at:

http://www.foolabs.com/xpdf/download.html

VII. CVE INFORMATION

The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CAN-2005-3193 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.

VIII. DISCLOSURE TIMELINE

10/13/2005 Initial vendor notification
10/19/2005 Initial vendor response
12/05/2005 Coordinated public disclosure

IX. CREDIT

iDefense credits infamous41md@hotpop.com with the discovery of this
vulnerability.

Get paid for vulnerability research
http://www.iDefense.com/poi/teams/vcp.jsp

Free tools, research and upcoming events
http://labs.iDefense.com

X. LEGAL NOTICES

Copyright C 2005 iDefense, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@iDefense.com for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.

*******************************************************************

Multiple Vendor xpdf StreamPredictor Heap Overflow Vulnerability

iDefense Security Advisory 12.05.05
www.idefense.com/application/poi/display?id=344&type=vulnerabilities
December 5, 2005

I. BACKGROUND

Xpdf is an open-source viewer for Portable Document Format (PDF) files.

II. DESCRIPTION

Local exploitation of a heap-based buffer overflow vulnerability in
xpdf, as included by various vendor's software distributions, could
allow attackers to cause a denial of service (DoS) condition,
potentially resulting in arbitrary code execution.

The vulnerability specifically exists due to insufficient input
validation in the Predictor stream parsing code. The
StreamPredictor::StreamPredictor function from xpdf/Stream.cc takes the
value of numComps from user-controllable data from within the PDF file.
The numComps value is used in a series of calcualations within the
StreamPredictor function. Using specially crafted values, a call to
gmalloc can be forced to allocate the minimum number of bytes, which
may later be overrun with user-supplied data from the PDF file leading
to corruption of heap memory that might result in a DoS condition or
arbitrary code execution.

III. ANALYSIS

Exploitation could result in arbitrary code execution with privileges
of the xpdf process. Currently, exploitation resulting in code
execution is theoretical and dependant on the process memory layout. A
typical exploitation attempt would require an attacker to supply a
malicious pdf to the victim. The victim would need to open the corrupt
pdf file in xpdf. Only then would the vulnerability be triggered.

IV. DETECTION

iDefense has confirmed the existence of this vulnerability in xpdf
3.01. All earlier versions of xpdf are suspected vulnerable.

The following vendors include susceptible xpdf packages within their
operating system distributions:

. The Debian Project: Linux 3.0 and 3.1

V. WORKAROUND

iDefense is currently unaware of any effective workarounds for this
vulnerability.

VI. VENDOR RESPONSE

A patch for this vulnerability is available at:

ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.01pl1.patch

Updated binaries (version 3.01pl1) are available at:

http://www.foolabs.com/xpdf/download.html

VII. CVE INFORMATION

The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CAN-2005-3192 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.

VIII. DISCLOSURE TIMELINE

10/13/2005 Initial vendor notification
10/19/2005 Initial vendor response
12/05/2005 Coordinated public disclosure

IX. CREDIT

iDefense credits infamous41md@hotpop.com with the discovery of this
vulnerability.

Get paid for vulnerability research
http://www.iDefense.com/poi/teams/vcp.jsp

Free tools, research and upcoming events
http://labs.iDefense.com

X. LEGAL NOTICES

Copyright C 2005 iDefense, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@iDefense.com for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.
  • Accessibility |
  • Terms and conditions |
  • Privacy statement |
  • Data protection act |
  • Freedom of information |