зеркало из https://github.com/github/codeql.git
JS: Add step through spread arg to path.join()
This commit is contained in:
Родитель
a826c8327a
Коммит
d49359a95c
|
@ -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()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче