@@ -941,7 +941,7 @@ private module Stdlib {
941
941
or
942
942
// Type-preserving call
943
943
exists ( DataFlow:: Node nodeFrom , DataFlow:: TypeTracker t2 |
944
- nodeFrom . getALocalSource ( ) = pathlibPath ( t2 ) and
944
+ pathlibPath ( t2 ) . flowsTo ( nodeFrom ) and
945
945
t2 .end ( )
946
946
|
947
947
t .start ( ) and
@@ -962,7 +962,7 @@ private module Stdlib {
962
962
exists ( BinaryExprNode slash , DataFlow:: Node pathOperand , DataFlow:: TypeTracker t2 |
963
963
slash .getOp ( ) instanceof Div and
964
964
pathOperand .asCfgNode ( ) = slash .getAnOperand ( ) and
965
- pathOperand . getALocalSource ( ) = pathlibPath ( t2 ) and
965
+ pathlibPath ( t2 ) . flowsTo ( pathOperand ) and
966
966
t2 .end ( )
967
967
|
968
968
t .start ( ) and
@@ -972,7 +972,7 @@ private module Stdlib {
972
972
// standard case
973
973
exists ( DataFlow:: AttrRead returnsPath , DataFlow:: TypeTracker t2 |
974
974
returnsPath .getAttributeName ( ) = pathlibPathInjection ( ) and
975
- returnsPath . getObject ( ) . getALocalSource ( ) = pathlibPath ( t2 ) and
975
+ pathlibPath ( t2 ) . flowsTo ( returnsPath . getObject ( ) ) and
976
976
t2 .end ( )
977
977
|
978
978
t .start ( ) and
@@ -997,7 +997,7 @@ private module Stdlib {
997
997
"rename" , "replace" , "resolve" , "rglob" , "rmdir" , "samefile" , "symlink_to" , "touch" ,
998
998
"unlink" , "link_to" , "write_bytes" , "write_text"
999
999
] and
1000
- fileAccess . getObject ( ) .getALocalSource ( ) = pathlibPath ( ) and
1000
+ pathlibPath ( ) .flowsTo ( fileAccess . getObject ( ) ) and
1001
1001
this .getFunction ( ) = fileAccess
1002
1002
}
1003
1003
@@ -1012,8 +1012,8 @@ private module Stdlib {
1012
1012
nodeFrom = nodeTo .( DataFlow:: CallCfgNode ) .getArg ( _)
1013
1013
or
1014
1014
// Type preservation
1015
- nodeFrom . getALocalSource ( ) = pathlibPath ( ) and
1016
- nodeTo . getALocalSource ( ) = pathlibPath ( ) and
1015
+ pathlibPath ( ) . flowsTo ( nodeFrom ) and
1016
+ pathlibPath ( ) . flowsTo ( nodeTo ) and
1017
1017
(
1018
1018
// Type-preserving call
1019
1019
typePreservingCall ( nodeFrom , nodeTo )
@@ -1023,13 +1023,13 @@ private module Stdlib {
1023
1023
)
1024
1024
or
1025
1025
// Data injection
1026
- nodeTo . getALocalSource ( ) = pathlibPath ( ) and
1026
+ pathlibPath ( ) . flowsTo ( nodeTo ) and
1027
1027
(
1028
1028
// Special handling of the `/` operator
1029
1029
exists ( BinaryExprNode slash , DataFlow:: Node pathOperand |
1030
1030
slash .getOp ( ) instanceof Div and
1031
1031
pathOperand .asCfgNode ( ) = slash .getAnOperand ( ) and
1032
- pathOperand . getALocalSource ( ) = pathlibPath ( )
1032
+ pathlibPath ( ) . flowsTo ( pathOperand )
1033
1033
|
1034
1034
nodeTo .asCfgNode ( ) = slash and
1035
1035
// Taint can flow either from the left or the right operand as long as one of them is a path.
@@ -1052,7 +1052,7 @@ private module Stdlib {
1052
1052
)
1053
1053
or
1054
1054
// Export data from type
1055
- nodeFrom . getALocalSource ( ) = pathlibPath ( ) and
1055
+ pathlibPath ( ) . flowsTo ( nodeFrom ) and
1056
1056
(
1057
1057
// exporting attribute
1058
1058
exists ( DataFlow:: AttrRead export |
0 commit comments