mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
JS: BufferTaintStep
This commit is contained in:
@@ -340,16 +340,16 @@ module NodeJSLib {
|
||||
/**
|
||||
* A model of taint propagation through `new Buffer` and `Buffer.from`.
|
||||
*/
|
||||
private class BufferTaintStep extends TaintTracking::AdditionalTaintStep, DataFlow::InvokeNode {
|
||||
BufferTaintStep() {
|
||||
this = DataFlow::globalVarRef("Buffer").getAnInstantiation()
|
||||
or
|
||||
this = DataFlow::globalVarRef("Buffer").getAMemberInvocation("from")
|
||||
}
|
||||
|
||||
private class BufferTaintStep extends TaintTracking::SharedTaintStep {
|
||||
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
pred = getArgument(0) and
|
||||
succ = this
|
||||
exists(DataFlow::InvokeNode invoke |
|
||||
invoke = DataFlow::globalVarRef("Buffer").getAnInstantiation()
|
||||
or
|
||||
invoke = DataFlow::globalVarRef("Buffer").getAMemberInvocation("from")
|
||||
|
|
||||
pred = invoke.getArgument(0) and
|
||||
succ = invoke
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user