Skip to content

Commit 6474cfd

Browse files
committed
add support for express-ws
1 parent d55e9d5 commit 6474cfd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,13 @@ module ServerWebSocket {
214214
class ServerSocket extends EventEmitter::Range, DataFlow::SourceNode {
215215
LibraryName library;
216216

217-
ServerSocket() { this = getAConnectionCall(library).getCallback(1).getParameter(0) }
217+
ServerSocket() {
218+
this = getAConnectionCall(library).getCallback(1).getParameter(0)
219+
or
220+
// support for the express-ws library: https://www.npmjs.com/package/express-ws
221+
library = ws() and
222+
this = Express::appCreation().getAMemberCall("ws").getABoundCallbackParameter(1, 0)
223+
}
218224

219225
/**
220226
* Gets the name of the library that created this server socket.

0 commit comments

Comments
 (0)