JS: add a taint step for property projection

This commit is contained in:
Esben Sparre Andreasen
2018-08-28 14:55:17 +02:00
parent df97132519
commit 90b3902244
5 changed files with 61 additions and 0 deletions

View File

@@ -134,4 +134,22 @@ private class SimplePropertyProjection extends CustomPropertyProjection {
override predicate isSingletonProjection() { singleton = true }
}
/**
* A taint step for a property projection.
*/
private class PropertyProjectionTaintStep extends TaintTracking::AdditionalTaintStep {
PropertyProjection projection;
PropertyProjectionTaintStep() {
projection = this
}
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
// reading from a tainted object yields a tainted result
this = succ and
pred = projection.getObject()
}
}