Update javascript/ql/src/Security/CWE-730/ServerCrash.ql

Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
This commit is contained in:
Esben Sparre Andreasen
2021-01-13 14:49:29 +01:00
committed by GitHub
parent d591c519a8
commit 12b985be87

View File

@@ -40,6 +40,7 @@ Function invokedByRouteHandler(HTTP::RouteHandler rh) {
// follow the immediate call graph
exists(DataFlow::InvokeNode invk |
result = invk.getACallee() and
// purposely not checking for `getEnclosingTryCatchStmt`. An async callback called from inside a try-catch can still crash the server.
invk.getEnclosingFunction() = invokedByRouteHandler(rh)
)
// if new edges are added here, the `edges` predicate should be updated accordingly