Bug 1295385 (CVE-2016-1283)

Summary: CVE-2016-1283 pcre: heap buffer overflow in handling of duplicate named groups (8.39/14)
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: carnil, jorton, lkundrak, mmaslano, ppisar, rcollet, rmeggins, sardella, slawomir, webstack-team, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pcre 8.39 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-26 12:03:56 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: 1295386, 1330490, 1330491, 1330494    
Bug Blocks: 1295388    

Description Adam Mariš 2016-01-04 10:06:59 UTC
It was found that pcre_compile2 function in pcre_compile.c in PCRE 8.38 mishandles the 
/((?:F?+(?:^(?(R)a+\"){99}-))(?J)(?'R'(?'R'<((?'RR'(?'R'\){97)?J)?J)(?'R'(?'R'\){99|(:(?|(?'R')(\k'R')|((?'R')))H'R'R)(H'R))))))/
pattern and related patterns with named subgroups, which allows remote attackers to cause a denial of service via heap-based buffer overflow.

Upstream bug:

https://bugs.exim.org/show_bug.cgi?id=1767

Comment 1 Adam Mariš 2016-01-04 10:07:40 UTC
Created pcre tracking bugs for this issue:

Affects: fedora-all [bug 1295386]

Comment 2 Tomas Hoger 2016-02-17 16:50:27 UTC
As noted in the upstream bug, I would reduce the pattern triggering the issue down to:

  /((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/

This issue was introduced in version 8.34, which refactored named group handling code and apparently several bugs were introduced in the process.

Comment 3 Tomas Hoger 2016-02-29 09:15:02 UTC
Upstream fix:

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

Comment 4 Fedora Update System 2016-03-02 01:50:09 UTC
pcre-8.38-6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2016-03-16 01:49:57 UTC
pcre-8.38-3.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 errata-xmlrpc 2016-05-26 08:42:49 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