JS: introduce Vue::InstanceHeapStep

This commit is contained in:
Esben Sparre Andreasen
2019-01-25 13:10:47 +01:00
parent 014d4b9ed0
commit 9f4f945975
7 changed files with 41 additions and 0 deletions

View File

@@ -366,4 +366,26 @@ module Vue {
class VueFile extends File {
VueFile() { getExtension() = "vue" }
}
/**
* A taint propagating data flow edge through a Vue instance property.
*/
class InstanceHeapStep extends TaintTracking::AdditionalTaintStep {
DataFlow::Node src;
InstanceHeapStep() {
exists(Instance i, string name, DataFlow::FunctionNode bound |
bound.flowsTo(i.getABoundFunction()) and
not bound.getFunction() instanceof ArrowFunctionExpr and
bound.getReceiver().getAPropertyRead(name) = this and
src = i.getAPropertyValue(name)
)
}
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
pred = src and succ = this
}
}
}