Skip to content

Commit 93e4084

Browse files
committed
Ruby: enable for PolyReDos but document why it still doesnt work
1 parent 9f348c3 commit 93e4084

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ private module PolynomialReDoSConfig implements DataFlow::ConfigSig {
1818
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
1919

2020
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
21+
22+
predicate observeDiffInformedIncrementalMode() { any() }
23+
24+
Location getASelectedSinkLocation(DataFlow::Node sink) {
25+
result = sink.(Sink).getHighlight().getLocation()
26+
}
27+
28+
Location getASelectedSinkLocationApprox(DataFlow::Node sink) {
29+
// TODO: Still fails tests due to RegExpTerms having incorrect locations when the regexp is parsed from a string arising from constant folding.
30+
result = sink.(Sink).getRegExp().getRootTerm().getLocation()
31+
}
2132
}
2233

2334
/**

0 commit comments

Comments
 (0)