File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ abstract class FileSystemAccess extends DataFlow::Node {
2929 abstract DataFlow:: Node getAPathArgument ( ) ;
3030}
3131
32+ /**
33+ * A data flow node that contains a file name or an array of file names from the local file system.
34+ */
35+ abstract class FileNameSource extends DataFlow:: Node {
36+
37+ }
38+
3239/**
3340 * A data flow node that performs a database access.
3441 */
Original file line number Diff line number Diff line change @@ -365,6 +365,22 @@ module NodeJSLib {
365365 }
366366 }
367367
368+ /**
369+ * A data flow node that contains a file name or an array of file names from the local file system.
370+ */
371+ private class NodeJSFileNameSource extends FileNameSource {
372+
373+ NodeJSFileNameSource ( ) {
374+ exists ( string name |
375+ name = "readdir" or
376+ name = "realpath" |
377+ this = fsModuleMember ( name ) .getACall ( ) .getCallback ( [ 1 ..2 ] ) .getParameter ( 1 ) or
378+ this = fsModuleMember ( name + "Sync" ) .getACall ( )
379+ )
380+ }
381+
382+ }
383+
368384 /**
369385 * A call to a method from module `child_process`.
370386 */
You can’t perform that action at this time.
0 commit comments