Skip to content

Commit 6b579df

Browse files
committed
normalize auth-headers to lowercase
1 parent 87c0c60 commit 6b579df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

javascript/ql/src/semmle/javascript/security/SensitiveActions.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,22 @@ module PasswordHeuristics {
197197
isDummyPassword(header)
198198
or
199199
exists(string prefix, string suffix | prefix = getAnHTTPAuthenticationScheme() |
200-
header = prefix + " " + suffix and
200+
header.toLowerCase() = prefix + " " + suffix and
201201
isDummyPassword(suffix)
202202
)
203203
or
204-
header.trim() = getAnHTTPAuthenticationScheme()
204+
header.trim().toLowerCase() = getAnHTTPAuthenticationScheme()
205205
}
206206

207207
/**
208-
* Gets a HTTP authentication scheme.
208+
* Gets a HTTP authentication scheme normalized to lowercase.
209209
* From this list: https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml
210210
*/
211211
private string getAnHTTPAuthenticationScheme() {
212212
result =
213213
[
214214
"Basic", "Bearer", "Digest", "HOBA", "Mutual", "Negotiate", "OAuth", "SCRAM-SHA-1",
215215
"SCRAM-SHA-256", "vapid"
216-
]
216+
].toLowerCase()
217217
}
218218
}

0 commit comments

Comments
 (0)