File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/experimental/semmle/python/frameworks
test/experimental/library-tests/frameworks/flask Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,12 @@ private module Flask {
117117 /** A route setup made by flask (sharing handling of URL patterns). */
118118 abstract private class FlaskRouteSetup extends HTTP:: Server:: RouteSetup:: Range {
119119 override Parameter getARoutedParameter ( ) {
120+ // If we don't know the URL pattern, we simply mark all parameters as a routed
121+ // parameter. This should give us more RemoteFlowSources but could also lead to
122+ // more FPs. If this turns out to be the wrong tradeoff, we can always change our mind.
123+ not exists ( this .getUrlPattern ( ) ) and
124+ result = this .getARouteHandler ( ) .getArgByName ( _)
125+ or
120126 exists ( string name |
121127 result = this .getARouteHandler ( ) .getArgByName ( name ) and
122128 exists ( string match |
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def later_set(): # $f-:routeHandler
2424
2525
2626@app .route (UNKNOWN_ROUTE ) # $routeSetup
27- def unkown_route (foo , bar ): # $routeHandler
27+ def unkown_route (foo , bar ): # $routeHandler $routedParameter=foo $routedParameter=bar
2828 return make_response ("unkown_route" )
2929
3030
You can’t perform that action at this time.
0 commit comments