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 {
100100 * seen as a source for downloads of sensitive files through an insecure connection.
101101 */
102102 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 ( ) ) }
109104
110105 override DataFlow:: FlowState getALabel ( ) { result instanceof Label:: Sensitive }
111106 }
@@ -134,8 +129,9 @@ module InsecureDownload {
134129 }
135130
136131 /**
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()`.
139135 */
140136 private class HttpResponseAsSink extends Sink {
141137 private HTTP:: Client:: Request req ;
You can’t perform that action at this time.
0 commit comments