Skip to content

Commit f87cd16

Browse files
committed
ML: add defensive check to ensure Unknown endpoints cannot also be NotASink
1 parent f2b813a commit f87cd16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointData.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ private DataFlow::Node getANotASink(NotASinkReason reason) {
7575
*/
7676
private DataFlow::Node getAnUnknown(Query query) {
7777
getAtmCfg(query).isEffectiveSink(result) and
78+
// Effective sinks should exclude sinks but this is a defensive requirement
7879
not result = getASink(query) and
80+
// Effective sinks should exclude NotASink but for some queries (e.g. Xss) this is currently not always the case and
81+
// so this is a defensive requirement
82+
not result = getANotASink(_) and
7983
// Only consider the source code for the project being analyzed.
8084
exists(result.getFile().getRelativePath())
8185
}

0 commit comments

Comments
 (0)