Skip to content

Commit d65da1f

Browse files
committed
Ruby: enable for PolyReDos but document why it still doesnt work
1 parent 8b34551 commit d65da1f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ 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+
// Diff-informedness is disabled because of RegExpTerms having incorrect locations when
23+
// the regexp is parsed from a string arising from constant folding.
24+
predicate observeDiffInformedIncrementalMode() { none() }
25+
26+
Location getASelectedSinkLocation(DataFlow::Node sink) {
27+
result = sink.(Sink).getHighlight().getLocation()
28+
}
29+
30+
Location getASelectedSinkLocationApprox(DataFlow::Node sink) {
31+
result = sink.(Sink).getRegExp().getRootTerm().getLocation()
32+
}
2133
}
2234

2335
/**

0 commit comments

Comments
 (0)