mirror of
https://github.com/github/codeql.git
synced 2026-04-25 00:35:20 +02:00
JS: Add step through spread arg to path.join()
This commit is contained in:
@@ -847,6 +847,22 @@ module TaintedPath {
|
||||
dst = call and
|
||||
srclabel = dstlabel
|
||||
)
|
||||
or
|
||||
exists(DataFlow::CallNode join |
|
||||
// path.join() with spread argument
|
||||
join = NodeJSLib::Path::moduleMember("join").getACall() and
|
||||
src = join.getASpreadArgument() and
|
||||
dst = join and
|
||||
(
|
||||
srclabel.(Label::PosixPath).canContainDotDotSlash()
|
||||
or
|
||||
srclabel instanceof Label::SplitPath
|
||||
) and
|
||||
dstlabel.(Label::PosixPath).isNormalized() and
|
||||
if isRelative(join.getArgument(0).getStringValue())
|
||||
then dstlabel.(Label::PosixPath).isRelative()
|
||||
else dstlabel.(Label::PosixPath).isAbsolute()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user