File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
javascript/ql/lib/semmle/javascript/security/dataflow Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -847,6 +847,22 @@ module TaintedPath {
847
847
dst = call and
848
848
srclabel = dstlabel
849
849
)
850
+ or
851
+ exists ( DataFlow:: CallNode join |
852
+ // path.join() with spread argument
853
+ join = NodeJSLib:: Path:: moduleMember ( "join" ) .getACall ( ) and
854
+ src = join .getASpreadArgument ( ) and
855
+ dst = join and
856
+ (
857
+ srclabel .( Label:: PosixPath ) .canContainDotDotSlash ( )
858
+ or
859
+ srclabel instanceof Label:: SplitPath
860
+ ) and
861
+ dstlabel .( Label:: PosixPath ) .isNormalized ( ) and
862
+ if isRelative ( join .getArgument ( 0 ) .getStringValue ( ) )
863
+ then dstlabel .( Label:: PosixPath ) .isRelative ( )
864
+ else dstlabel .( Label:: PosixPath ) .isAbsolute ( )
865
+ )
850
866
}
851
867
852
868
/**
You can’t perform that action at this time.
0 commit comments