8000 Merge pull request #19379 from github/cklin/python-polynomial-redos · github/codeql@ed69097 · GitHub
[go: up one dir, main page]

Skip to content

Commit ed69097

Browse files
authored
Merge pull request #19379 from github/cklin/python-polynomial-redos
Python: disable diff-informed PolynomialReDoS.ql
2 parents 432435f + 6c1e80d commit ed69097

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ private module PolynomialReDoSConfig implements DataFlow::ConfigSig {
1818

1919
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
2020

21-
predicate observeDiffInformedIncrementalMode() { any() }
21+
// Diff-informed incremental mode is currently disabled for this query due to
22+
// API limitations. The query exposes sink.getABacktrackingTerm() as an alert
23+
// location, but there is no way to express that information through
24+
// getASelectedSinkLocation() because there is no @location in the CodeQL
25+
// database that corresponds to a term inside a regular expression. As a
26+
// result, this query could miss alerts in diff-informed incremental mode.
27+
//
28+
// To address this problem, we need to have a version of
29+
// getASelectedSinkLocation() that uses hasLocationInfo() instead of
30+
// returning Location objects.
31+
predicate observeDiffInformedIncrementalMode() { none() }
2232

2333
Location getASelectedSinkLocation(DataFlow::Node sink) {
2434
result = sink.(Sink).getHighlight().getLocation()

0 commit comments

Comments
 (0)
0