File tree 2 files changed +6
-1
lines changed
javascript/ql/test/query-tests/Security/CWE-020/SuspiciousRegexpRange
shared/regex/codeql/regex
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -27,4 +27,6 @@ var overlapsWithClass1 = /[0-9\d]/; // NOT OK
27
27
var overlapsWithClass2 = / [ \w , . - ? : * + ] / ; // NOT OK
28
28
29
29
var tst2 = / ^ ( [ ァ - ヾ ] | [ ァ - ン ゙ ゚ ] ) + $ / ; // OK
30
- var tst3 = / [ 0 - 9 0 - 9 ] / ; // OK
30
+ var tst3 = / [ 0 - 9 0 - 9 ] / ; // OK
31
+
32
+ var question = / [ 0 - ? ] / ; // OK. matches one of: 0123456789:;<=>?
Original file line number Diff line number Diff line change @@ -129,6 +129,9 @@ module Make<RegexTreeViewSig TreeImpl> {
129
129
or
130
130
// starting from the zero byte is a good indication that it's purposely matching a large range.
131
131
result .isRange ( 0 .toUnicode ( ) , _)
132
+ or
133
+ // the range 0123456789:;<=>? is intentional
134
+ result .isRange ( "0" , "?" )
132
135
}
133
136
134
137
/** Gets a char between (and including) `low` and `high`. */
You can’t perform that action at this time.
0 commit comments