Skip to content

Commit a85811a

Browse files
committed
Remove unused field
1 parent 6998608 commit a85811a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ruby/ql/lib/codeql/ruby/security/InsecureDownloadCustomizations.qll

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)