use the EventEmitter registration methods instead of just "on" · github/codeql@0b55aed · GitHub
Skip to content

Commit 0b55aed

Browse files
committed
use the EventEmitter registration methods instead of just "on"
1 parent cfbdf21 commit 0b55aed

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎javascript/ql/src/semmle/javascript/frameworks/Files.qll‎

Lines changed: 2 additions & 2 deletions

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ module NodeJSLib {
530530
FileStreamRead() {
531531
stream.getMethodName() = "createReadStream" and
532532
this = stream.getAMemberCall(method) and
533-
(method = "read" or method = "pipe" or method = "on")
533+
(method = "read" or method = "pipe" or method = EventEmitter::on())
534534
}
535535

536536
override DataFlow::Node getADataNode() {
@@ -540,7 +540,7 @@ module NodeJSLib {
540540
method = "pipe" and
541541
result = getArgument(0)
542542
or
543-
method = "on" and
543+
method = EventEmitter::on() and
544544
getArgument(0).mayHaveStringValue("data") and
545545
result = getCallback(1).getParameter(0)
546546
}
@@ -751,7 +751,7 @@ module NodeJSLib {
751751
promise = false and
752752
exists(DataFlow::ParameterNode res, DataFlow::CallNode onData |
753753
res = getCallback(1).getParameter(0) and
754-
onData = res.getAMethodCall("on") and
754+
onData = res.getAMethodCall(EventEmitter::on()) and
755755
onData.getArgument(0).mayHaveStringValue("data") and
756756
result = onData.getCallback(1).getParameter(0) and
757757
responseType = "arraybuffer"
@@ -768,7 +768,7 @@ module NodeJSLib {
768768

769769
ClientRequestHandler() {
770770
exists(DataFlow::MethodCallNode mcn |
771-
clientRequest.getAMethodCall("on") = mcn and
771+
clientRequest.getAMethodCall(EventEmitter::on()) = mcn and
772772
mcn.getArgument(0).mayHaveStringValue(handledEvent) and
773773
flowsTo(mcn.getArgument(1))
774774
)
@@ -805,7 +805,7 @@ module NodeJSLib {
805805
private class ClientRequestDataEvent extends RemoteFlowSource {
806806
ClientRequestDataEvent() {
807807
exists(DataFlow::MethodCallNode mcn, ClientRequestResponseEvent cr |
808-
cr.getAMethodCall("on") = mcn and
808+
cr.getAMethodCall(EventEmitter::on()) = mcn and
809809
mcn.getArgument(0).mayHaveStringValue("data") and
810810
this = mcn.getCallback(1).getParameter(0)
811811
)

‎javascript/ql/src/semmle/javascript/security/dataflow/ZipSlipCustomizations.qll‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)