Skip to content

Commit a317f2b

Browse files
committed
Test for endpoints scored at inference time
Adds a test to detect changes in the endpoints that get scored at inference time.
1 parent 2653458 commit a317f2b

File tree

3 files changed

+315
-0
lines changed

3 files changed

+315
-0
lines changed

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/ATMConfig.qll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ abstract class AtmConfig extends JS::TaintTracking::Configuration {
154154
not AtmResultsInfo::isFlowLikelyInBaseQuery(source.getNode(), sink.getNode()) and
155155
score = AtmResultsInfo::getScoreForFlow(source.getNode(), sink.getNode())
156156
}
157+
158+
/**
159+
* Holds if if `sink` is an effective sink with flow from `source` which gets used as a sink candidate for scoring
160+
* with the ML model.
161+
*/
162+
predicate isSinkCandidate(JS::DataFlow::PathNode sink) {
163+
exists(JS::DataFlow::PathNode source |
164+
this.hasFlowPath(source, sink) and
165+
not AtmResultsInfo::isFlowLikelyInBaseQuery(source.getNode(), sink.getNode())
166+
)
167+
}
157168
}
158169

159170
/** DEPRECATED: Alias for AtmConfig */

0 commit comments

Comments
 (0)