mirror of
https://github.com/github/codeql.git
synced 2026-05-11 01:39:28 +02:00
add fetch.Headers.Authorization as a CredentialsExpr
This commit is contained in:
@@ -1147,5 +1147,21 @@ module NodeJSLib {
|
||||
or
|
||||
result = DataFlow::globalVarRef("fetch")
|
||||
}
|
||||
|
||||
/** An expression that is passed as `http.request({ auth: <expr> }, ...)`. */
|
||||
class FetchAuthorization extends CredentialsExpr {
|
||||
FetchAuthorization() {
|
||||
this =
|
||||
moduleImport()
|
||||
.getAConstructorInvocation("Headers")
|
||||
.getArgument(0)
|
||||
.getALocalSource()
|
||||
.getAPropertyWrite("Authorization")
|
||||
.getRhs()
|
||||
.asExpr()
|
||||
}
|
||||
|
||||
override string getCredentialsKind() { result = "authorization headers" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user