@@ -1069,10 +1069,10 @@ module SuffixConstruction {
10691069}
10701070
10711071/**
1072- * Holds if `term` may cause exponential backtracking on strings containing many repetitions of `witness `.
1072+ * Holds if `term` may cause exponential backtracking on strings containing many repetitions of `pump `.
10731073 * Gets the minimum possible string that causes exponential backtracking.
10741074 */
1075- predicate isReDoSAttackable ( RegExpTerm term , string witness , State s ) {
1075+ predicate isReDoSAttackable ( RegExpTerm term , string pump , State s ) {
10761076 exists ( int i , string c | s = Match ( term , i ) |
10771077 c =
10781078 min ( string w |
@@ -1081,7 +1081,7 @@ predicate isReDoSAttackable(RegExpTerm term, string witness, State s) {
10811081 |
10821082 w order by w .length ( ) , w
10831083 ) and
1084- witness = escape ( rotate ( c , i ) )
1084+ pump = escape ( rotate ( c , i ) )
10851085 )
10861086}
10871087
@@ -1111,17 +1111,17 @@ string escape(string s) {
11111111/**
11121112 * Gets `str` with the last `i` characters moved to the front.
11131113 *
1114- * We use this to adjust the witness string to match with the beginning of
1114+ * We use this to adjust the pump string to match with the beginning of
11151115 * a RegExpTerm, so it doesn't start in the middle of a constant.
11161116 */
11171117bindingset [ str, i]
11181118string rotate ( string str , int i ) {
11191119 result = str .suffix ( str .length ( ) - i ) + str .prefix ( str .length ( ) - i )
11201120}
11211121
1122- from RegExpTerm t , string witness , State s , string prefixMsg
1122+ from RegExpTerm t , string pump , State s , string prefixMsg
11231123where
1124- isReDoSAttackable ( t , witness , s ) and
1124+ isReDoSAttackable ( t , pump , s ) and
11251125 (
11261126 prefixMsg = "starting with '" + escape ( PrefixConstruction:: prefix ( s ) ) + "' and " and
11271127 not PrefixConstruction:: prefix ( s ) = ""
@@ -1132,4 +1132,4 @@ where
11321132 )
11331133select t ,
11341134 "This part of the regular expression may cause exponential backtracking on strings " + prefixMsg +
1135- "containing many repetitions of '" + witness + "'."
1135+ "containing many repetitions of '" + pump + "'."
0 commit comments