Skip to content

Commit df72492

Browse files
author
Esben Sparre Andreasen
committed
JS: polish FileAccessToHttp.qll
1 parent 43f98a7 commit df72492

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

javascript/ql/src/semmle/javascript/security/dataflow/FileAccessToHttp.qll

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
/**
2-
* Provides Taint tracking configuration for reasoning about file access taint flow to http post body
1+
/**
2+
* Provides a taint tracking configuration for reasoning about file data in outbound remote requests.
33
*/
44
import javascript
5-
import semmle.javascript.frameworks.HTTP
5+
import semmle.javascript.security.dataflow.RemoteFlowSources
6+
7+
module FileAccessToHttp {
68

7-
module FileAccessToHttpDataFlow {
89
/**
9-
* A data flow source for reasoning about file access to http post body flow vulnerabilities.
10+
* A data flow source for file data in outbound remote requests.
1011
*/
1112
abstract class Source extends DataFlow::Node { }
1213

1314
/**
14-
* A data flow sink for reasoning about file access to http post body flow vulnerabilities.
15+
* A data flow sink for file data in outbound remote requests.
1516
*/
1617
abstract class Sink extends DataFlow::Node { }
1718

1819
/**
19-
* A sanitizer for reasoning about file access to http post body flow vulnerabilities.
20+
* A sanitizer for file data in outbound remote requests.
2021
*/
2122
abstract class Sanitizer extends DataFlow::Node { }
2223

2324
/**
24-
* A taint-tracking configuration for reasoning about file access to http post body flow vulnerabilities.
25+
* A taint tracking configuration for file data in outbound remote requests.
2526
*/
2627
class Configuration extends TaintTracking::Configuration {
27-
Configuration() { this = "FileAccessToHttpDataFlow" }
28+
Configuration() {
29+
this = "FileAccessToHttp"
30+
}
2831

2932
override predicate isSource(DataFlow::Node source) {
3033
source instanceof Source
@@ -38,7 +41,7 @@ module FileAccessToHttpDataFlow {
3841
super.isSanitizer(node) or
3942
node instanceof Sanitizer
4043
}
41-
44+
4245
/** additional taint step that taints an object wrapping a source */
4346
override predicate isAdditionalTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
4447
(
@@ -53,7 +56,9 @@ module FileAccessToHttpDataFlow {
5356
}
5457
}
5558

56-
/** A source is a file access parameter, as in readFromFile(buffer). */
59+
/**
60+
* A file access parameter, considered as a flow source for file data in outbound remote requests.
61+
*/
5762
private class FileAccessArgumentAsSource extends Source {
5863
FileAccessArgumentAsSource() {
5964
exists(FileSystemReadAccess src |
@@ -63,7 +68,7 @@ module FileAccessToHttpDataFlow {
6368
}
6469

6570
/**
66-
* The URL or data of a client request, viewed as a sink.
71+
* The URL or data of a client request, considered as a flow source for file data in outbound remote requests.
6772
*/
6873
private class ClientRequestUrlOrDataAsSink extends Sink {
6974
ClientRequestUrlOrDataAsSink () {

0 commit comments

Comments
 (0)