mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
are shared with Tcl, since it's their code to begin with, and the patches have been copied from Tcl 8.5.0. Problems: CVE-2007-4769: Inadequate check on the range of backref numbers allows crash due to out-of-bounds read. CVE-2007-4772: Infinite loop in regex optimizer for pattern '($|^)*'. CVE-2007-6067: Very slow optimizer cleanup for regex with a large NFA representation, as well as crash if we encounter an out-of-memory condition during NFA construction. Part of the response to CVE-2007-6067 is to put a limit on the number of states in the NFA representation of a regex. This seems needed even though the within-the-code problems have been corrected, since otherwise the code could try to use very large amounts of memory for a suitably-crafted regex, leading to potential DOS by driving the system into swap, activating a kernel OOM killer, etc. Although there are certainly plenty of ways to drive the system into effective DOS with poorly-written SQL queries, these problems seem worth treating as security issues because many applications might accept regex search patterns from untrustworthy sources. Thanks to Will Drewry of Google for reporting these problems. Patches by Will Drewry and Tom Lane. Security: CVE-2007-4769, CVE-2007-4772, CVE-2007-6067
80 lines
1.2 KiB
C
80 lines
1.2 KiB
C
/*
|
|
* $PostgreSQL: pgsql/src/include/regex/regerrs.h,v 1.3.8.1 2008/01/03 20:48:49 tgl Exp $
|
|
*/
|
|
|
|
{
|
|
REG_OKAY, "REG_OKAY", "no errors detected"
|
|
},
|
|
|
|
{
|
|
REG_NOMATCH, "REG_NOMATCH", "failed to match"
|
|
},
|
|
|
|
{
|
|
REG_BADPAT, "REG_BADPAT", "invalid regexp (reg version 0.8)"
|
|
},
|
|
|
|
{
|
|
REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"
|
|
},
|
|
|
|
{
|
|
REG_ECTYPE, "REG_ECTYPE", "invalid character class"
|
|
},
|
|
|
|
{
|
|
REG_EESCAPE, "REG_EESCAPE", "invalid escape \\ sequence"
|
|
},
|
|
|
|
{
|
|
REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"
|
|
},
|
|
|
|
{
|
|
REG_EBRACK, "REG_EBRACK", "brackets [] not balanced"
|
|
},
|
|
|
|
{
|
|
REG_EPAREN, "REG_EPAREN", "parentheses () not balanced"
|
|
},
|
|
|
|
{
|
|
REG_EBRACE, "REG_EBRACE", "braces {} not balanced"
|
|
},
|
|
|
|
{
|
|
REG_BADBR, "REG_BADBR", "invalid repetition count(s)"
|
|
},
|
|
|
|
{
|
|
REG_ERANGE, "REG_ERANGE", "invalid character range"
|
|
},
|
|
|
|
{
|
|
REG_ESPACE, "REG_ESPACE", "out of memory"
|
|
},
|
|
|
|
{
|
|
REG_BADRPT, "REG_BADRPT", "quantifier operand invalid"
|
|
},
|
|
|
|
{
|
|
REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"
|
|
},
|
|
|
|
{
|
|
REG_INVARG, "REG_INVARG", "invalid argument to regex function"
|
|
},
|
|
|
|
{
|
|
REG_MIXED, "REG_MIXED", "character widths of regex and string differ"
|
|
},
|
|
|
|
{
|
|
REG_BADOPT, "REG_BADOPT", "invalid embedded option"
|
|
},
|
|
|
|
{
|
|
REG_ETOOBIG, "REG_ETOOBIG", "nfa has too many states"
|
|
},
|