mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
remove some FPs in js/password-in-configuration-file
This commit is contained in:
@@ -27,9 +27,9 @@ where
|
||||
not val.regexpMatch("\\$.*|%.*%") and
|
||||
not PasswordHeuristics::isDummyPassword(val)
|
||||
or
|
||||
key.toLowerCase() != "readme" and
|
||||
// look for `password=...`, but exclude `password=;`, `password="$(...)"`,
|
||||
not key.toLowerCase() = ["readme", "run"] and
|
||||
// look for `password=...`, but exclude `password=;`, `password="$(...)"`, `password=foo()`
|
||||
// `password=%s` and `password==`
|
||||
pwd = val.regexpCapture("(?is).*password\\s*=\\s*(?!;|\"?[$`]|%s|=)(\\S+).*", 1)
|
||||
pwd = val.regexpCapture("(?is).*password\\s*=\\s*(?!;|\"?[$`]|%s|=|\\w+\\(.+\\))(\\S+).*", 1)
|
||||
)
|
||||
select valElement.(FirstLineOf), "Hard-coded password '" + pwd + "' in configuration file."
|
||||
|
||||
Reference in New Issue
Block a user