JavaScript: add taint step from return value of 'map' callback

This commit is contained in:
Asger F
2018-08-10 10:08:05 +01:00
parent 0c124d2f8c
commit 66dcd7d4c7

View File

@@ -207,6 +207,13 @@ module TaintTracking {
this = DataFlow::parameterNode(p) and
pred.asExpr() = m.getReceiver()
)
or
// `array.map` with tainted return value in callback
exists (MethodCallExpr m, Function f |
this.asExpr() = m and
m.getMethodName() = "map" and
m.getArgument(0) = f and // Require the argument to be a closure to avoid spurious call/return flow
pred = f.getAReturnedExpr().flow())
)
or
// reading from a tainted object yields a tainted result