Skip to content

Commit bc04131

Browse files
committed
JS: Disallow implicit reads before an optional step
1 parent e1bed42 commit bc04131

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

javascript/ql/lib/semmle/javascript/dataflow/internal/TaintTrackingPrivate.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,7 @@ predicate defaultTaintSanitizer(DataFlow::Node node) {
6161
bindingset[node]
6262
predicate defaultImplicitTaintRead(DataFlow::Node node, ContentSet c) {
6363
exists(node) and
64-
c = [ContentSet::promiseValue(), ContentSet::arrayElement()]
64+
c = [ContentSet::promiseValue(), ContentSet::arrayElement()] and
65+
// Optional steps are added through isAdditionalFlowStep but we don't want the implicit reads
66+
not optionalStep(node, _, _)
6567
}

0 commit comments

Comments
 (0)