@@ -907,13 +907,15 @@ module Routing {
907
907
/**
908
908
* Like `getAnAccessPathRhs` but with `base` mapped to its root node.
909
909
*/
910
+ pragma [ nomagic]
910
911
private DataFlow:: Node getAnAccessPathRhsUnderRoot ( RootNode root , int n , string path ) {
911
912
result = getAnAccessPathRhs ( root .getADescendant ( ) , n , path )
912
913
}
913
914
914
915
/**
915
916
* Like `getAnAccessPathRead` but with `base` mapped to its root node.
916
917
*/
918
+ pragma [ nomagic]
917
919
private DataFlow:: SourceNode getAnAccessPathReadUnderRoot ( RootNode root , int n , string path ) {
918
920
result = getAnAccessPathRead ( root .getADescendant ( ) , n , path )
919
921
}
@@ -928,7 +930,7 @@ module Routing {
928
930
private predicate middlewareApiStep ( DataFlow:: SourceNode pred , DataFlow:: SourceNode succ ) {
929
931
exists ( RootNode root , int n , string path |
930
932
pred = getAnAccessPathRhsUnderRoot ( root , n , path ) and
931
- succ = getAnAccessPathReadUnderRoot ( root , n , path )
933
+ succ = getAnAccessPathReadUnderRoot ( root , n , pragma [ only_bind_out ] ( path ) )
932
934
)
933
935
or
934
936
// We can't augment the call graph as this depends on type tracking, so just
@@ -947,13 +949,21 @@ module Routing {
947
949
}
948
950
}
949
951
952
+ pragma [ nomagic]
953
+ private predicate potentialAccessPathStep (
954
+ Node writer , DataFlow:: SourceNode pred , Node reader , DataFlow:: SourceNode succ , int n ,
955
+ string path
956
+ ) {
957
+ pred = getAnAccessPathRhs ( writer , n , path ) and
958
+ succ = getAnAccessPathRead ( reader , n , pragma [ only_bind_out ] ( path ) )
959
+ }
960
+
950
961
/**
951
962
* Holds if `pred -> succ` is a data-flow step between access paths on request input objects.
952
963
*/
953
964
private predicate middlewareDataFlowStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
954
965
exists ( Node writer , Node reader , int n , string path |
955
- pred = getAnAccessPathRhs ( writer , n , path ) and
956
- succ = getAnAccessPathRead ( reader , n , path ) and
966
+ potentialAccessPathStep ( writer , pred , reader , succ , n , path ) and
957
967
pragma [ only_bind_out ] ( reader ) .isGuardedByNode ( pragma [ only_bind_out ] ( writer ) )
958
968
)
959
969
or
0 commit comments