Skip to content

Commit

Permalink
Java: Diff-informed PolynomialReDoS.ql
Browse files Browse the repository at this point in the history
This and other queries would also benefit from making `RegexFlow`
diff-informed. That will come later.
  • Loading branch information
jbj committed Dec 20, 2024
1 parent 5bebae9 commit 2b1c70c
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ module PolynomialRedosConfig implements DataFlow::ConfigSig {
node instanceof SimpleTypeSanitizer or
node.asExpr().(MethodCall).getMethod() instanceof LengthRestrictedMethod
}

predicate observeDiffInformedIncrementalMode() { any() }

Location getASelectedSinkLocation(DataFlow::Node sink) {
exists(SuperlinearBackTracking::PolynomialBackTrackingTerm regexp |
regexp.getRootTerm() = sink.(PolynomialRedosSink).getRegExp()
|
result = sink.getLocation()
or
result = regexp.getLocation()
)
}
}

module PolynomialRedosFlow = TaintTracking::Global<PolynomialRedosConfig>;

0 comments on commit 2b1c70c

Please sign in to comment.