mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
JS: add a taint step for property projection
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user