Bug 1287614 (CVE-2015-8383)

Summary: CVE-2015-8383 pcre: Buffer overflow caused by repeated conditional group (8.38/3)
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: adam.stokes, andrew, carnil, csutherl, databases-maint, dknox, erik-fedora, fedora-mingw, fedora, fidencio, jclere, jdornak, jdoyle, jgrulich, jorton, klember, lgao, lkundrak, marcandre.lureau, mbabacek, mclasen, mmaslano, myarboro, ppisar, pslavice, rcollet, rjones, rmeggins, rsvoboda, sardella, slawomir, twalsh, walters, webstack-team, weli, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pcre 8.38 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-15 13:36:29 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: 1287615, 1287616, 1287617, 1287619, 1330455, 1330456    
Bug Blocks: 1287727    

Description Adam Mariš 2015-12-02 13:05:25 UTC
It was found that PCRE before 8.38 mishandles certain repeated conditional groups whose condition was referenced by name if there was more than one group with the given name, which allows remote attackers to cause a denial of service (buffer overflow) or possibly have unspecified other impact via a crafted regular expression.

Comment 1 Adam Mariš 2015-12-02 13:06:15 UTC
Created pcre tracking bugs for this issue:

Affects: fedora-all [bug 1287615]

Comment 2 Adam Mariš 2015-12-02 13:06:24 UTC
Created glib2 tracking bugs for this issue:

Affects: fedora-all [bug 1287617]

Comment 3 Adam Mariš 2015-12-02 13:06:33 UTC
Created mingw-pcre tracking bugs for this issue:

Affects: fedora-all [bug 1287616]
Affects: epel-7 [bug 1287619]

Comment 4 Petr Pisar 2015-12-02 14:24:25 UTC
Fixed by upstream in 8.38 version with:

commit 67286d4e31be9cdeef981955efbdf6ec9da53f42
Author: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
Date:   Fri May 8 16:39:40 2015 +0000

    Fix buffer overflow for repeated conditional when referencing a duplicate na
me.
    
    
    git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1557 2f5784b3-3f2a-0410-8824-
cb99058d5e15

Reproducer: Pass /(((?(R)){0,2}) (?''((?'R')((?'R')))))/J pattern to pcretest under valgrind.

Comment 5 Petr Pisar 2015-12-02 14:28:49 UTC
Fixed with pcre-8.38-1.fc23 in F23 on 2015-11-26.

Comment 6 Adam Mariš 2015-12-02 15:22:36 UTC
Corresponds to item 3 under 8.38 in http://vcs.pcre.org/pcre/code/trunk/ChangeLog?view=markup

Comment 7 Fedora Update System 2016-01-04 19:53:57 UTC
pcre-8.38-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Tomas Hoger 2016-02-17 09:24:51 UTC
(In reply to Petr Pisar from comment #4)
> Fixed by upstream in 8.38 version with:
> 
> commit 67286d4e31be9cdeef981955efbdf6ec9da53f42
> Author: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
> Date:   Fri May 8 16:39:40 2015 +0000
> 
> Fix buffer overflow for repeated conditional when referencing a
> duplicate name.

That upstream commit is:

http://vcs.pcre.org/pcre?view=revision&revision=1557

Comment 9 Tomas Hoger 2016-02-17 09:26:30 UTC
This was introduced in version 8.34, which refactored named group handling code and apparently several bugs were introduced in the process.

Comment 11 errata-xmlrpc 2016-05-26 08:41:28 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS

Via RHSA-2016:1132 https://access.redhat.com/errata/RHSA-2016:1132

Comment 12 errata-xmlrpc 2016-11-15 11:47:36 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS

Via RHSA-2016:2750 https://rhn.redhat.com/errata/RHSA-2016-2750.html