mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
add taint step through flatten libraries
This commit is contained in:
@@ -389,4 +389,21 @@ private module ArrayLibraries {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A taint step through a call to `Array.prototype.flat` or a polyfill implementing array flattening.
|
||||
*/
|
||||
private class ArrayFlatStep extends TaintTracking::SharedTaintStep {
|
||||
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
exists(DataFlow::CallNode call | succ = call |
|
||||
call.(DataFlow::MethodCallNode).getMethodName() = "flat" and
|
||||
pred = call.getReceiver()
|
||||
or
|
||||
call =
|
||||
API::moduleImport(["array-flatten", "arr-flatten", "flatten", "array.prototype.flat"])
|
||||
.getACall() and
|
||||
pred = call.getAnArgument()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user