Bug 1777537 (CVE-2019-19246) - CVE-2019-19246 oniguruma: heap-based buffer overflow in str_lower_case_match in regexec.c
Summary: CVE-2019-19246 oniguruma: heap-based buffer overflow in str_lower_case_match ...
Keywords:
Status: NEW
Alias: CVE-2019-19246
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1777538 1777539 1781612 1781613 1781614 1781615 1781616 1781617 1777540 1780460 1780461 1780462 1781609 1781610 1781611 1781618 1781619
Blocks: 1777541
TreeView+ depends on / blocked
 
Reported: 2019-11-27 18:35 UTC by Guilherme de Almeida Suckevicz
Modified: 2019-12-10 10:36 UTC (History)
24 users (show)

Fixed In Version: oniguruma 6.9.4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Guilherme de Almeida Suckevicz 2019-11-27 18:35:13 UTC
Oniguruma through 6.9.3, as used in PHP 7.3.x and other products, has a heap-based buffer over-read in str_lower_case_match in regexec.c.

Reference:
https://bugs.php.net/bug.php?id=78559

Upstream commit:
https://github.com/kkos/oniguruma/commit/d3e402928b6eb3327f8f7d59a9edfa622fec557b

Comment 1 Guilherme de Almeida Suckevicz 2019-11-27 18:35:30 UTC
Created oniguruma tracking bugs for this issue:

Affects: epel-7 [bug 1777538]
Affects: fedora-all [bug 1777540]
Affects: openstack-rdo [bug 1777539]

Comment 2 Mark Cooper 2019-12-06 05:00:21 UTC
The following containers are packaged with OpenShift 4.x and contain a vulnerable version of oniguruma (5.9.x):
 - openshift4/ose-metering-hadoop
 - openshift4/ose-metering-hive
 - openshift4/ose-metering-presto

However, these containers include oniguruma but do not use it. This includes faq and jq which may use oniguruma, and are included within the containers but likewise, are unused.

Comment 6 Stefan Cornelius 2019-12-10 10:29:46 UTC
Using the regex provided in the upstream bug report, I can't reproduce this issue until after the following commit:
https://github.com/kkos/oniguruma/commit/4d461376bd85e7994835677b2ff453a43c49cd28

I'm currently not aware of a method to trigger this in prior versions, although the additional check added to the str_lower_case_match() function as part of the upstream patch for this CVE still applies to older versions. Thus, this may very well only be a defense-in-depth patch for older versions.

Apart from that, the impact of this issue appears very limited: we read a small amount of out-of-bounds heap memory. This could potentially lead to a crash, although in the vast majority of cases, it won't even do that. Furthermore, an attacker would need to be able to provide a regex to the application using oniguruma, which is usually a bad idea in itself.


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