File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
ruby/ql/lib/codeql/ruby/security Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -100,12 +100,7 @@ module InsecureDownload {
100
100
* seen as a source for downloads of sensitive files through an insecure connection.
101
101
*/
102
102
class SensitiveFileUrl extends Source {
103
- string str ;
104
-
105
- SensitiveFileUrl ( ) {
106
- str = this .asExpr ( ) .getConstantValue ( ) .getString ( ) and
107
- hasUnsafeExtension ( str )
108
- }
103
+ SensitiveFileUrl ( ) { hasUnsafeExtension ( this .asExpr ( ) .getConstantValue ( ) .getString ( ) ) }
109
104
110
105
override DataFlow:: FlowState getALabel ( ) { result instanceof Label:: Sensitive }
111
106
}
@@ -134,8 +129,9 @@ module InsecureDownload {
134
129
}
135
130
136
131
/**
137
- * A response from an outgoing HTTP request, considered as a flow sink for
138
- * downloading a sensitive file through an insecure connection.
132
+ * A response from an outgoing HTTP request.
133
+ * This is a sink if there are both insecure and sensitive parts of the URL.
134
+ * In other words, if the URL is HTTP and the extension is in `unsafeExtension()`.
139
135
*/
140
136
private class HttpResponseAsSink extends Sink {
141
137
private HTTP:: Client:: Request req ;
You can’t perform that action at this time.
0 commit comments