Skip to content

Commit 7c26efb

Browse files
committed
case insensitive authorization header
1 parent b508ad4 commit 7c26efb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javascript/ql/src/semmle/javascript/frameworks/ClientRequests.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,13 @@ module ClientRequest {
263263
/** An expression that is used as a credential in a request. */
264264
private class AuthorizationHeader extends CredentialsExpr {
265265
AuthorizationHeader() {
266-
exists(DataFlow::PropWrite write | write.getPropertyName() = "Authorization" |
266+
exists(DataFlow::PropWrite write | write.getPropertyName().regexpMatch("(?i)authorization") |
267267
this = write.getRhs().asExpr()
268268
)
269269
or
270270
exists(DataFlow::MethodCallNode call | call.getMethodName() = ["append", "set"] |
271271
call.getNumArgument() = 2 and
272-
call.getArgument(0).mayHaveStringValue("Authorization") and
272+
call.getArgument(0).getStringValue().regexpMatch("(?i)authorization") and
273273
this = call.getArgument(1).asExpr()
274274
)
275275
}

0 commit comments

Comments
 (0)