mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
Updated SocketClass to use API Graphs.
This commit is contained in:
10
javascript/ql/src/Security/trest/test.ql
Normal file
10
javascript/ql/src/Security/trest/test.ql
Normal file
@@ -0,0 +1,10 @@
|
||||
import javascript
|
||||
|
||||
API::NewNode getAWebSocketInstance() { result instanceof ClientWebSocket::ClientSocket }
|
||||
|
||||
from DataFlow::Node handler
|
||||
where
|
||||
handler = getAWebSocketInstance().getReturn().getMember("onmessage").asSource()
|
||||
or
|
||||
handler = getAWebSocketInstance().getAPropertyWrite("onmessage").getRhs()
|
||||
select handler, "This is a WebSocket onmessage handler."
|
||||
Reference in New Issue
Block a user