File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
csharp/ql/lib/semmle/code/csharp
security/dataflow/flowsources Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -366,6 +366,27 @@ class MicrosoftAspNetCoreBuilderEndpointRouteBuilderExtensions extends Class {
366366 this .hasQualifiedName ( "Microsoft.AspNetCore.Builder" , "EndpointRouteBuilderExtensions" )
367367 }
368368
369- /** Gets the `UseMap` extension method. */
369+ /** Gets the `Map` extension method. */
370+ Method getMapMethod ( ) { result = this .getAMethod ( "Map" ) }
371+
372+ /** Gets the `MapGet` extension method. */
370373 Method getMapGetMethod ( ) { result = this .getAMethod ( "MapGet" ) }
374+
375+ /** Gets the `MapPost` extension method. */
376+ Method getMapPostMethod ( ) { result = this .getAMethod ( "MapPost" ) }
377+
378+ /** Gets the `MapPut` extension method. */
379+ Method getMapPutMethod ( ) { result = this .getAMethod ( "MapPut" ) }
380+
381+ /** Gets the `MapDelete` extension method. */
382+ Method getMapDeleteMethod ( ) { result = this .getAMethod ( "MapDelete" ) }
383+
384+ /** Get a `Map` like extenion methods. */
385+ Method getAMapMethod ( ) {
386+ result =
387+ [
388+ this .getMapMethod ( ) , this .getMapGetMethod ( ) , this .getMapPostMethod ( ) ,
389+ this .getMapPutMethod ( ) , this .getMapDeleteMethod ( )
390+ ]
391+ }
371392}
Original file line number Diff line number Diff line change @@ -173,8 +173,7 @@ abstract class AspNetCoreRemoteFlowSource extends RemoteFlowSource { }
173173
174174private predicate reachesMapGetArg ( DataFlow:: Node n ) {
175175 exists ( MethodCall mc |
176- mc .getTarget ( ) =
177- any ( MicrosoftAspNetCoreBuilderEndpointRouteBuilderExtensions c ) .getMapGetMethod ( ) and
176+ mc .getTarget ( ) = any ( MicrosoftAspNetCoreBuilderEndpointRouteBuilderExtensions c ) .getAMapMethod ( ) and
178177 n .asExpr ( ) = mc .getArgument ( 2 )
179178 )
180179 or
You can’t perform that action at this time.
0 commit comments