Skip to content

Commit 8f0b999

Browse files
authored
Merge pull request #10207 from erik-krogh/fixRank
fix performance issue in the ReDoS query
2 parents 25ee554 + 77949cb commit 8f0b999

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

java/ql/lib/semmle/code/java/security/regexp/ExponentialBackTracking.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ private newtype TStatePair =
115115
private int rankState(State state) {
116116
state =
117117
rank[result](State s, Location l |
118+
stateInsideBacktracking(s) and
118119
l = s.getRepr().getLocation()
119120
|
120121
s order by l.getStartLine(), l.getStartColumn(), s.toString()

javascript/ql/lib/semmle/javascript/security/regexp/ExponentialBackTracking.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ private newtype TStatePair =
115115
private int rankState(State state) {
116116
state =
117117
rank[result](State s, Location l |
118+
stateInsideBacktracking(s) and
118119
l = s.getRepr().getLocation()
119120
|
120121
s order by l.getStartLine(), l.getStartColumn(), s.toString()

python/ql/lib/semmle/python/security/regexp/ExponentialBackTracking.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ private newtype TStatePair =
115115
private int rankState(State state) {
116116
state =
117117
rank[result](State s, Location l |
118+
stateInsideBacktracking(s) and
118119
l = s.getRepr().getLocation()
119120
|
120121
s order by l.getStartLine(), l.getStartColumn(), s.toString()

ruby/ql/lib/codeql/ruby/security/regexp/ExponentialBackTracking.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ private newtype TStatePair =
115115
private int rankState(State state) {
116116
state =
117117
rank[result](State s, Location l |
118+
stateInsideBacktracking(s) and
118119
l = s.getRepr().getLocation()
119120
|
120121
s order by l.getStartLine(), l.getStartColumn(), s.toString()

0 commit comments

Comments
 (0)