Skip to content

Commit 14b26f2

Browse files
committed
add mkdirp as a sink for tainted-path
1 parent e0a123c commit 14b26f2

File tree

4 files changed

+325
-0
lines changed

4 files changed

+325
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lgtm,codescanning
2+
* The `js/tainted-path` now recognizes the `mkdirp` library as a sink.
3+
Affected packages are
4+
[mkdirp](https://www.npmjs.com/package/mkdirp)

javascript/ql/src/semmle/javascript/frameworks/Files.qll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,16 @@ class Chokidar extends FileNameProducer, FileSystemAccess, API::CallNode {
470470
)
471471
}
472472
}
473+
474+
/**
475+
* A call to the [`mkdirp`](https://www.npmjs.com/package/mkdirp) library.
476+
*/
477+
private class Mkdirp extends FileSystemAccess, API::CallNode {
478+
Mkdirp() {
479+
this = API::moduleImport("mkdirp").getACall()
480+
or
481+
this = API::moduleImport("mkdirp").getMember("sync").getACall()
482+
}
483+
484+
override DataFlow::Node getAPathArgument() { result = getArgument(0) }
485+
}

0 commit comments

Comments
 (0)