Regular Expression: Evil Regex
Evil Regex contains:
Grouping with repetition
Inside the repeated group:
Repetition
Alternation with overlapping
Examples:
(a+)+([a-zA-Z]+)*(a|aa)+(a|a?)+(.*a){x}for x > 10
These regular expressions can be exploited with aaaaaaaaaaaaaaaaaaaaaaaa! (20 'a's followed by a '!').
aaaaaaaaaaaaaaaaaaaa! For this input, the regex engine will try all possible ways to group the a characters before realizing that the match ultimately fails because of the !. This results in an explosion of backtracking attempts.
Comments
No comments yet.