DISPUTED In PCRE 8.41, after compiling, a pcretest load test PoC produces a crash overflow in the function match() in pcreexec.c because of a self-recursive call. NOTE: third parties dispute the relevance of this report, noting that there are options that can be used to limit the amount of stack that is used.
In PCRE 8.41, the OPKETRMAX feature in the match function in pcreexec.c allows stack exhaustion (uncontrolled recursion) when processing a crafted regular expression.
A denial of service flaw was found in the way syslog-ng processed certain log patterns, when 'global' flag was speficied and PCRE backend was used for matching. A remote attacker could use this flaw to cause excessive memory use by the syslog-ng process via specially-crafted pattern.
References: [1] http://www.securityfocus.com/bid/47800/info [2] https://lists.balabit.hu/pipermail/syslog-ng/2011-May/016576.html
Upstream patch: [3] http://git.balabit.hu/?p=bazsi/syslog-ng-3.2.git;a=commit;h=09710c0b105e579d35c7b5f6c66d1ea5e3a3d3ff
PCRE is a Perl-compatible regular expression library.Flaws were discovered in the way PCRE handles certain malformed regularexpressions. If an application linked against PCRE parses a maliciousregular expression, it may have been possible to run arbitrary code as theuser running the application. (CVE-2006-7228, CVE-2007-1660)Users of PCRE are advised to upgrade to these updated packages, whichcontain backported patches to resolve these issues.Red Hat would like to thank Ludwig Nussel for reporting these issues.
PCRE is a Perl-compatible regular expression library.Flaws were discovered in the way PCRE handles certain malformed regularexpressions. If an application linked against PCRE, such as Konqueror,parsed a malicious regular expression, it may have been possible to runarbitrary code as the user running the application. (CVE-2006-7228,CVE-2007-1660)Users of PCRE are advised to upgrade to these updated packages, whichcontain backported patches to resolve these issues.Red Hat would like to thank Ludwig Nussel for reporting these issues.
CVE-2006-7224 initially described several integer overflows in pcre, all described here: http://scary.beasts.org/security/CESA-2007-006.html
This id should be used to describe issue #2 in that advisory:
3) More possible integer overflow trouble.
pcrecompile: --- if (min == 0) { length++; if (max > 0) length += (max - 1) (duplength + 3 + 2LINKSIZE); } ... else { length += (min - 1) duplength; if (max > min) / Need this test as max=-1 means no limit / length += (max - min) (duplength + 3 + 2LINKSIZE) - (2 + 2LINKSIZE); } ---
In both these cases, I see no reason why a malicious regexp pattern couldn't cause an integer overflow by using large min / max / duplength values. This will really mess up the critical "length" value.
CVE-2006-7224 initially described several integer overflows in pcre, all described here: http://scary.beasts.org/security/CESA-2007-006.html
This id should be used to describe issue #2 in that advisory:
2) Uncharacterized crash researching item #1 above: Demo:
(?P<0>)(?P<1>)...fill in this sequence...(?P<3999>)
This does not trigger the integer overflow present in #1 above, but still crashes with a serious-looking memory error of some kind - possibly a buffer overflow.
CVE-2006-7224 initially described several integer overflows in pcre, all described here: http://scary.beasts.org/security/CESA-2007-006.html
This id should be used to describe issue #1 in that advisory:
1) Integer overflow leading to buffer overflow.
pcrecompile: --- / Compute the size of data block needed and get it, either from malloc or externally provided function. /
size = length + sizeof(realpcre) + namecount (maxnamesize + 3); re = (realpcre )(pcremalloc)(size); ---
Unfortunately, a malicious regex can easily cause large "namecount" and "maxnamesize" such that this calculation overflows. Demo:
(?P)(?P<0>)(?P<1>)...fill in this sequence...(?P<4293>)