@@ -118,10 +118,14 @@ class FileSystemAccess extends DataFlow::Node instanceof FileSystemAccess::Range
118118 DataFlow:: Node getAPathArgument ( ) { result = super .getAPathArgument ( ) }
119119
120120 /**
121- * Gets an argument to this file system access that is interpreted as a path,
122- * but which is not vulnerable to path injection.
121+ * Gets an argument to this file system access that is interpreted as a path
122+ * which is vulnerable to path injection.
123+ *
124+ * By default all path arguments are considered vulnerable, but this can be overridden to
125+ * exclude certain arguments that are known to be safe, for example because they are
126+ * restricted to a specific directory.
123127 */
124- DataFlow:: Node getASafePathArgument ( ) { result = super .getASafePathArgument ( ) }
128+ DataFlow:: Node getAVulnerablePathArgument ( ) { result = super .getAVulnerablePathArgument ( ) }
125129}
126130
127131/** Provides a class for modeling new file system access APIs. */
@@ -138,10 +142,14 @@ module FileSystemAccess {
138142 abstract DataFlow:: Node getAPathArgument ( ) ;
139143
140144 /**
141- * Gets an argument to this file system access that is interpreted as a path,
142- * but which is not vulnerable to path injection.
145+ * Gets an argument to this file system access that is interpreted as a path
146+ * which is vulnerable to path injection.
147+ *
148+ * By default all path arguments are considered vulnerable, but this can be overridden to
149+ * exclude certain arguments that are known to be safe, for example because they are
150+ * restricted to a specific directory.
143151 */
144- DataFlow:: Node getASafePathArgument ( ) { none ( ) }
152+ DataFlow:: Node getAVulnerablePathArgument ( ) { result = this . getAPathArgument ( ) }
145153 }
146154}
147155
0 commit comments