Bug 1312782

Summary: pcre: Heap buffer overflow in pcretest causing infinite loop (8.39/15)
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: adam.stokes, andrew, csutherl, databases-maint, dknox, erik-fedora, fedora-mingw, fedora, fidencio, jclere, jdornak, jdoyle, jgrulich, jorton, klember, lgao, lkundrak, marcandre.lureau, mbabacek, mclasen, mmaslano, myarboro, pmyers, ppisar, pslavice, rcollet, rjones, rmeggins, rsvoboda, twalsh, walters, webstack-team, weli
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-03-17 14:06:19 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: 1312786, 1312788, 1312789, 1312791, 1312793, 1312794    
Bug Blocks: 1295388, 1312802    

Description Adam Mariš 2016-02-29 09:37:54 UTC
Heap-based buffer overread caused by specially crafted input triggering infinite loop in pcretest.c was found affecting pcre 8.38. pcretest went into loop if global matching was requested with an ovector size less than 2.

Upstream bug:

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

Upstream patch:

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

CVE request:

http://seclists.org/oss-sec/2016/q1/460

Comment 1 Adam Mariš 2016-02-29 09:38:21 UTC
Acknowledgments:

Name: Adam Mariš (Red Hat)

Comment 2 Adam Mariš 2016-02-29 09:39:35 UTC
Created pcre tracking bugs for this issue:

Affects: fedora-all [bug 1312786]

Comment 3 Adam Mariš 2016-02-29 09:39:49 UTC
Created glib2 tracking bugs for this issue:

Affects: fedora-all [bug 1312789]

Comment 4 Adam Mariš 2016-02-29 09:40:00 UTC
Created mingw-glib2 tracking bugs for this issue:

Affects: fedora-all [bug 1312791]
Affects: epel-7 [bug 1312794]

Comment 5 Adam Mariš 2016-02-29 09:40:13 UTC
Created mingw-pcre tracking bugs for this issue:

Affects: fedora-all [bug 1312788]
Affects: epel-7 [bug 1312793]

Comment 6 Tomas Hoger 2016-02-29 20:54:07 UTC
Minimal reproducer is:

//G
\O1

Comment 7 Fedora Update System 2016-03-02 01:50:18 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 8 Fedora Update System 2016-03-16 01:50:06 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 9 Tomas Hoger 2016-03-17 14:06:19 UTC
This is similar to bug 1285413 comment 7 and not relevant / security for the same reasons - pcretest is an application used for testing the pcre library.  It offers ways to use the library in ways that are incorrect with respect to the documented API.

Additionally, as this flaw is in the pcretest application, components that embed the pcre library while not using pcretest (e.g. glib2 mentioned above) could not have been affected.

Upstream version 8.13 is the first where infinite loop is triggered, valgrind reports "Conditional jump or move depends on uninitialised value(s)" error in earlier versions.