Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 957c406

Browse files
committed
JS: BufferTaintStep
1 parent 6bd2c2e commit 957c406

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

javascript/ql/src/semmle/javascript/frameworks/NodeJSLib.qll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,16 +340,16 @@ module NodeJSLib {
340340
/**
341341
* A model of taint propagation through `new Buffer` and `Buffer.from`.
342342
*/
343-
private class BufferTaintStep extends TaintTracking::AdditionalTaintStep, DataFlow::InvokeNode {
344-
BufferTaintStep() {
345-
this = DataFlow::globalVarRef("Buffer").getAnInstantiation()
346-
or
347-
this = DataFlow::globalVarRef("Buffer").getAMemberInvocation("from")
348-
}
349-
343+
private class BufferTaintStep extends TaintTracking::SharedTaintStep {
350344
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
351-
pred = getArgument(0) and
352-
succ = this
345+
exists(DataFlow::InvokeNode invoke |
346+
invoke = DataFlow::globalVarRef("Buffer").getAnInstantiation()
347+
or
348+
invoke = DataFlow::globalVarRef("Buffer").getAMemberInvocation("from")
349+
|
350+
pred = invoke.getArgument(0) and
351+
succ = invoke
352+
)
353353
}
354354
}
355355

0 commit comments

Comments
 (0)