Skip to content

Commit 3f95710

Browse files
committed
improve alert message - and autoformat
1 parent 056a7e8 commit 3f95710

4 files changed

Lines changed: 11 additions & 17 deletions

File tree

javascript/ql/src/Security/CWE-829/UnsecureDownload.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ import DataFlow::PathGraph
1616

1717
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
1818
where cfg.hasFlowPath(source, sink)
19-
select sink.getNode(), source, sink, "Download of file from $@.", source.getNode(), "HTTP source"
19+
select sink.getNode(), source, sink, "$@ of sensitive file from $@.",
20+
sink.getNode().(Sink).getDownloadCall(), "Download", source.getNode(), "HTTP source"

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@ module UnsecureDownload {
1717
class Configuration extends DataFlow::Configuration {
1818
Configuration() { this = "HTTP/HTTPS" }
1919

20-
override predicate isSource(DataFlow::Node source) {
21-
source instanceof Source
22-
}
20+
override predicate isSource(DataFlow::Node source) { source instanceof Source }
2321

24-
override predicate isSink(DataFlow::Node sink) {
25-
sink instanceof Sink
26-
}
22+
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
2723
}
2824
}

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,9 @@ module UnsecureDownload {
5959
*/
6060
class ClientRequestURL extends Sink {
6161
ClientRequest request;
62-
ClientRequestURL() {
63-
this = request.getUrl()
64-
}
6562

66-
override DataFlow::Node getDownloadCall() {
67-
result = request
68-
}
63+
ClientRequestURL() { this = request.getUrl() }
64+
65+
override DataFlow::Node getDownloadCall() { result = request }
6966
}
7067
}

javascript/ql/test/query-tests/Security/CWE-829/UnsecureDownload.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ edges
2727
| unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | unsecure-download.js:36:9:36:45 | url |
2828
| unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | unsecure-download.js:36:9:36:45 | url |
2929
#select
30-
| unsecure-download.js:5:16:5:28 | installer.url | unsecure-download.js:9:27:9:138 | 'http:/ ... ll.exe' | unsecure-download.js:5:16:5:28 | installer.url | Download of file from $@. | unsecure-download.js:9:27:9:138 | 'http:/ ... ll.exe' | HTTP source |
31-
| unsecure-download.js:30:12:30:42 | "http:/ ... fe.APK" | unsecure-download.js:30:12:30:42 | "http:/ ... fe.APK" | unsecure-download.js:30:12:30:42 | "http:/ ... fe.APK" | Download of file from $@. | unsecure-download.js:30:12:30:42 | "http:/ ... fe.APK" | HTTP source |
32-
| unsecure-download.js:37:23:37:25 | url | unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | unsecure-download.js:37:23:37:25 | url | Download of file from $@. | unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | HTTP source |
33-
| unsecure-download.js:39:26:39:28 | url | unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | unsecure-download.js:39:26:39:28 | url | Download of file from $@. | unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | HTTP source |
30+
| unsecure-download.js:5:16:5:28 | installer.url | unsecure-download.js:9:27:9:138 | 'http:/ ... ll.exe' | unsecure-download.js:5:16:5:28 | installer.url | $@ of sensitive file from $@. | unsecure-download.js:5:9:5:44 | nugget( ... => { }) | Download | unsecure-download.js:9:27:9:138 | 'http:/ ... ll.exe' | HTTP source |
31+
| unsecure-download.js:30:12:30:42 | "http:/ ... fe.APK" | unsecure-download.js:30:12:30:42 | "http:/ ... fe.APK" | unsecure-download.js:30:12:30:42 | "http:/ ... fe.APK" | $@ of sensitive file from $@. | unsecure-download.js:30:5:30:43 | nugget( ... e.APK") | Download | unsecure-download.js:30:12:30:42 | "http:/ ... fe.APK" | HTTP source |
32+
| unsecure-download.js:37:23:37:25 | url | unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | unsecure-download.js:37:23:37:25 | url | $@ of sensitive file from $@. | unsecure-download.js:37:5:37:42 | cp.exec ... () {}) | Download | unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | HTTP source |
33+
| unsecure-download.js:39:26:39:28 | url | unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | unsecure-download.js:39:26:39:28 | url | $@ of sensitive file from $@. | unsecure-download.js:39:5:39:46 | cp.exec ... () {}) | Download | unsecure-download.js:36:15:36:45 | "http:/ ... fe.APK" | HTTP source |

0 commit comments

Comments
 (0)