mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge pull request #20 from esben-semmle/js/more-auth-calls-and-rate-limiters
Approved by xiemaisi
This commit is contained in:
@@ -143,7 +143,7 @@ class AuthorizationCall extends SensitiveAction, DataFlow::CallNode {
|
||||
exists(string s | s = getCalleeName() |
|
||||
// name contains `login` or `auth`, but not as part of `loginfo` or `unauth`;
|
||||
// also exclude `author`
|
||||
s.regexpMatch("(?i).*(login(?!fo)|(?<!un)auth(?!or\\b)).*") and
|
||||
s.regexpMatch("(?i).*(login(?!fo)|(?<!un)auth(?!or\\b)|verify).*") and
|
||||
// but it does not start with `get` or `set`
|
||||
not s.regexpMatch("(?i)(get|set).*")
|
||||
)
|
||||
|
||||
@@ -131,7 +131,7 @@ abstract class RateLimiter extends Express::RouteHandlerExpr {
|
||||
*/
|
||||
class ExpressRateLimit extends RateLimiter {
|
||||
ExpressRateLimit() {
|
||||
DataFlow::moduleImport("express-rate-limit").getAnInstantiation().flowsToExpr(this)
|
||||
DataFlow::moduleImport("express-rate-limit").getAnInvocation().flowsToExpr(this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user