@@ -901,13 +901,15 @@ module Routing {
901
901
/**
902
902
* Like `getAnAccessPathRhs` but with `base` mapped to its root node.
903
903
*/
904
+ pragma [ nomagic]
904
905
private DataFlow:: Node getAnAccessPathRhsUnderRoot ( RootNode root , int n , string path ) {
905
906
result = getAnAccessPathRhs ( root .getADescendant ( ) , n , path )
906
907
}
907
908
908
909
/**
909
910
* Like `getAnAccessPathRead` but with `base` mapped to its root node.
910
911
*/
912
+ pragma [ nomagic]
911
913
private DataFlow:: SourceNode getAnAccessPathReadUnderRoot ( RootNode root , int n , string path ) {
912
914
result = getAnAccessPathRead ( root .getADescendant ( ) , n , path )
913
915
}
@@ -922,7 +924,7 @@ module Routing {
922
924
private predicate middlewareApiStep ( DataFlow:: SourceNode pred , DataFlow:: SourceNode succ ) {
923
925
exists ( RootNode root , int n , string path |
924
926
pred = getAnAccessPathRhsUnderRoot ( root , n , path ) and
925
- succ = getAnAccessPathReadUnderRoot ( root , n , path )
927
+ succ = getAnAccessPathReadUnderRoot ( root , n , pragma [ only_bind_out ] ( path ) )
926
928
)
927
929
or
928
930
// We can't augment the call graph as this depends on type tracking, so just
@@ -941,13 +943,21 @@ module Routing {
941
943
}
942
944
}
943
945
946
+ pragma [ nomagic]
947
+ private predicate potentialAccessPathStep (
948
+ Node writer , DataFlow:: SourceNode pred , Node reader , DataFlow:: SourceNode succ , int n ,
949
+ string path
950
+ ) {
951
+ pred = getAnAccessPathRhs ( writer , n , path ) and
952
+ succ = getAnAccessPathRead ( reader , n , pragma [ only_bind_out ] ( path ) )
953
+ }
954
+
944
955
/**
945
956
* Holds if `pred -> succ` is a data-flow step between access paths on request input objects.
946
957
*/
947
958
private predicate middlewareDataFlowStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
948
959
exists ( Node writer , Node reader , int n , string path |
949
- pred = getAnAccessPathRhs ( writer , n , path ) and
950
- succ = getAnAccessPathRead ( reader , n , path ) and
960
+ potentialAccessPathStep ( writer , pred , reader , succ , n , path ) and
951
961
pragma [ only_bind_out ] ( reader ) .isGuardedByNode ( pragma [ only_bind_out ] ( writer ) )
952
962
)
953
963
or
0 commit comments