JS: Disallow implicit reads before an optional step

This commit is contained in:
Asger F
2024-09-11 15:06:48 +02:00
parent e1bed42481
commit bc04131c72

View File

@@ -61,5 +61,7 @@ predicate defaultTaintSanitizer(DataFlow::Node node) {
bindingset[node]
predicate defaultImplicitTaintRead(DataFlow::Node node, ContentSet c) {
exists(node) and
c = [ContentSet::promiseValue(), ContentSet::arrayElement()]
c = [ContentSet::promiseValue(), ContentSet::arrayElement()] and
// Optional steps are added through isAdditionalFlowStep but we don't want the implicit reads
not optionalStep(node, _, _)
}