Skip to content

Commit 117f009

Browse files
committed
JS: use HTTP::RouteHandlerCandidateContainer in Express
1 parent 9964902 commit 117f009

File tree

2 files changed

+98
-1
lines changed

2 files changed

+98
-1
lines changed

javascript/ql/src/semmle/javascript/frameworks/Express.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ module Express {
119119
t.start() and
120120
result = getARouteHandlerExpr().flow().getALocalSource()
121121
or
122-
exists(DataFlow::TypeBackTracker t2 | result = getARouteHandler(t2).backtrack(t2, t))
122+
exists(DataFlow::TypeBackTracker t2, DataFlow::SourceNode succ | succ = getARouteHandler(t2) |
123+
result = succ.backtrack(t2, t)
124+
or
125+
exists(HTTP::RouteHandlerCandidateContainer container | result = container.getRouteHandler(succ)) and
126+
t = t2
127+
)
123128
}
124129

125130
override Expr getServer() { result.(Application).getARouteHandler() = getARouteHandler() }

0 commit comments

Comments
 (0)