Bug 166330 - CAN-2005-2491 PCRE heap overflow
CAN-2005-2491 PCRE heap overflow
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: pcre (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
Ben Levenson
: Security
Depends On:
Blocks: CVE-2005-2491
  Show dependency treegraph
 
Reported: 2005-08-19 07:35 EDT by Mark J. Cox (Product Security)
Modified: 2008-01-29 04:39 EST (History)
1 user (show)

See Also:
Fixed In Version: RHSA-2005-761
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-08 13:18:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Upstream patch from 6.1 to 6.2 to correct this issue (1.29 KB, patch)
2005-08-19 07:35 EDT, Mark J. Cox (Product Security)
no flags Details | Diff

  None (edit)
Description Mark J. Cox (Product Security) 2005-08-19 07:35:56 EDT
PCRE 6.2 was released recently which included a fix for a heap buffer overflow.
 PCRE is used by things such as Apache but only for configuration (therefore
making an exploit low severity).  A number of packages also include PCRE code
internally, I'll be adding separate bugs for those that contain PCRE and do not
use system PCRE later.

Changelog states:

1. There was no test for integer overflow of quantifier values. A construction
such as {1111111111111111} would give undefined results. What is worse, if
a minimum quantifier for a parenthesized subpattern overflowed and became
negative, the calculation of the memory size went wrong. This  could have led to
memory overwriting.

A minimal diff of the flaw is attached, the full 6.2 to 6.1 diff contains other
fixes that might be worth incorporating and a test for this flaw.
Comment 1 Mark J. Cox (Product Security) 2005-08-19 07:35:57 EDT
Created attachment 117907 [details]
Upstream patch from 6.1 to 6.2 to correct this issue
Comment 2 Mark J. Cox (Product Security) 2005-08-19 07:37:35 EDT
It's hard to assign a severity level to a library such as PCRE as it will depend
exactly on how applications use it.  Applications that parse untrusted regular
expressions are not particularly likely, therefore setting this to Moderate.

Comment 3 Mark J. Cox (Product Security) 2005-08-19 07:39:45 EDT
[vulnerable doesn't actually mean this has a security context, we need to look
how pcre is used in each case]

pcre 
        (rhel4, rhel3, rhel2.1, fc3, fc4)

exim                     (rhel4, fc3)
        VULNERABLE: confirmed contains pcre in rhel4, seems to 
        use internal version

gnumeric                                (fc3)
        VULNERABLE: contains pcre, and uses it

httpd            (rhel4, rhel3, fc3, fc4)
        SAFE: contains pcre, but uses system pcre

nmap                      (rhel4, fc3, fc4)
        SAFE: contains pcre, uses system pcre in rhel4

privoxy                                 (fc3, fc4)
        VULNERABLE: contains pcre, uses internal pcre

postfix                                 (rhel3, fc3, fc4)
        SAFE: contains pcre, but uses system pcre

php                     (rhel4, rhel3, rhel2.1, fc3, fc4)
        SAFE: contains pcre, but uses system pcre in rhel4, rhel3
        UNKNOWN: uses internal pcre in rhel2.1?

Python       (rhel4, rhel3, rhel2.1, fc3)

        UNKNOWN: Needs investigation
Comment 4 Ngo Than 2005-08-19 09:46:17 EDT
it's now fixed in pcre-3.4-2.1 (RHEL-2.1), pcre-3.9-10.2 (RHEL-3.0E),
pcre-4.5-3.2.RHEL4 (RHEL-4), pcre-4.5-3.1.1.fc3 and pcre-5.0-4.1.fc4
Comment 6 Red Hat Bugzilla 2005-09-08 13:18:23 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-761.html

Note You need to log in before you can comment on or make changes to this bug.