mirror of
https://github.com/github/codeql.git
synced 2026-05-12 10:19:29 +02:00
JS: Use routing trees to detect deeply tainted req.body
This commit is contained in:
@@ -613,10 +613,9 @@ module Express {
|
||||
|
||||
override predicate isUserControlledObject() {
|
||||
kind = "body" and
|
||||
exists(ExpressLibraries::BodyParser bodyParser, RouteHandlerExpr expr |
|
||||
expr.getBody() = request.getRouteHandler() and
|
||||
bodyParser.producesUserControlledObjects() and
|
||||
bodyParser.flowsToExpr(expr.getAMatchingAncestor())
|
||||
exists(ExpressLibraries::BodyParser bodyParser |
|
||||
Routing::getNode(request.getRouteHandler()).isGuardedBy(bodyParser) and
|
||||
bodyParser.producesUserControlledObjects()
|
||||
)
|
||||
or
|
||||
// If we can't find the middlewares for the route handler,
|
||||
|
||||
Reference in New Issue
Block a user