File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ module Express {
8989 /**
9090 * Holds if a call to `callee` inside `f` forwards all of the parameters from `f` to that call.
9191 */
92- private predicate forwardingCall ( DataFlow:: SourceNode callee , DataFlow :: FunctionNode f ) {
92+ private predicate forwardingCall ( DataFlow:: SourceNode callee , HTTP :: RouteHandlerCandidate f ) {
9393 exists ( DataFlow:: CallNode call | call = callee .getACall ( ) |
9494 f .getNumParameter ( ) >= 2 and
9595 forall ( int arg | arg = [ 0 .. f .getNumParameter ( ) - 1 ] |
Original file line number Diff line number Diff line change @@ -574,21 +574,20 @@ module HTTP {
574574 read = DataFlow:: lvalueNode ( any ( ForOfStmt stmt ) .getLValue ( ) )
575575 or
576576 // for forwarding calls to an element where the key is determined by the request.
577- getRequestParameterRead ( read .getContainer ( ) .( Function ) .flow ( ) )
578- .flowsToExpr ( read .getPropertyNameExpr ( ) )
577+ getRequestParameterRead ( ) .flowsToExpr ( read .getPropertyNameExpr ( ) )
579578 )
580579 }
581580 }
582581
583582 /**
584583 * Gets a (chained) property-read/method-call on the request parameter of the route-handler `f`.
585584 */
586- private DataFlow:: SourceNode getRequestParameterRead ( RouteHandlerCandidate f ) {
587- result = f .getParameter ( 0 )
585+ private DataFlow:: SourceNode getRequestParameterRead ( ) {
586+ result = any ( RouteHandlerCandidate f ) .getParameter ( 0 )
588587 or
589- result = getRequestParameterRead ( f ) .getAPropertyRead ( )
588+ result = getRequestParameterRead ( ) .getAPropertyRead ( )
590589 or
591- result = getRequestParameterRead ( f ) .getAMethodCall ( )
590+ result = getRequestParameterRead ( ) .getAMethodCall ( )
592591 }
593592
594593 /**
You can’t perform that action at this time.
0 commit comments