Skip to content

Commit eee8b51

Browse files
committed
Java: Diff-informed PredictableSeed.ql
1 parent 6287426 commit eee8b51

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

java/ql/lib/semmle/code/java/security/RandomQuery.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ private module PredictableSeedFlowConfig implements DataFlow::ConfigSig {
3737
predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
3838
predictableCalcStep(node1.asExpr(), node2.asExpr())
3939
}
40+
41+
predicate observeDiffInformedIncrementalMode() { any() }
42+
43+
Location getASelectedSinkLocation(DataFlow::Node sink) {
44+
// This predicate matches `PredictableSeed.ql`, which is the only place
45+
// where `PredictableSeedFlowConfig` is used.
46+
exists(GetRandomData da, VarRead use |
47+
result = da.getLocation() and
48+
da.getQualifier() = use and
49+
isSeeding(sink.asExpr(), use)
50+
)
51+
}
4052
}
4153

4254
private module PredictableSeedFlow = DataFlow::Global<PredictableSeedFlowConfig>;

0 commit comments

Comments
 (0)