mirror of
https://github.com/github/codeql.git
synced 2026-07-23 20:22:02 +02:00
1.4 KiB
1.4 KiB
category
| category |
|---|
| minorAnalysis |
- The C++ regular-expression parser (
semmle.code.cpp.regex.internal.ParseRegExp) now models POSIX Basic Regular Expressions (BRE) via a new concreteBreRegExpsubclass. BRE is selected by thestd::regex_constants::basicandgrepflags. Where BRE inverts the metacharacter/escape convention relative to POSIX ERE and ECMAScript — backslash-prefixed\(...\)are capturing groups (bare(...)are literals),\{n,m\}is the interval quantifier (bare braces are literal text), and+,?,|are literal characters — the parser follows the POSIX specification. Positional rules for*(literal at the start of a subexpression),^(anchor only at start of subexpression) and$(anchor only at end of subexpression) are implemented;\1..\9numbered back-references are supported. The GNU-BRE extensions\+,\?,\|are not modeled — they are treated as escaped literals. Along with ECMAScript (EcmaRegExp) and POSIX ERE (EreRegExp), all six of thestd::regex_constantsgrammar flags now have a concrete parser subclass and every regex is analyzed. - The C++ ReDoS queries (
cpp/redosandcpp/polynomial-redos) now analyze regexes constructed with thestd::regex_constants::basicgrammar flag;grepremains excluded viaisBacktrackingEngine(POSIX tool-style engines are treated as linear-time), mirroring the existingextended-vs-egrep/awksplit for ERE.