Update python/ql/src/Security/CWE-798/HardcodedCredentials.ql

Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
This commit is contained in:
Mathew Payne
2024-07-01 14:29:00 +01:00
committed by GitHub
parent ed314b1799
commit 96048f962e

View File

@@ -81,7 +81,10 @@ class HardcodedValueSource extends DataFlow::Node {
class CredentialSink extends DataFlow::Node {
CredentialSink() {
this = ModelOutput::getASinkNode("credentials-hardcoded").asSink()
exists(string s | s.matches("credentials-%") |
// Actual sink-type will be things like `credentials-password` or `credentials-username`
this = ModelOutput::getASinkNode(s).asSink()
)
or
exists(string name |
name.regexpMatch(getACredentialRegex()) and