mirror of
https://github.com/github/codeql.git
synced 2026-05-11 01:39:28 +02:00
add support for string concatenations and base64-encoding of hardcoded credentials
This commit is contained in:
@@ -20,5 +20,12 @@ module HardcodedCredentials {
|
||||
override predicate isSource(DataFlow::Node source) { source instanceof Source }
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
|
||||
|
||||
override predicate isAdditionalFlowStep(DataFlow::Node src, DataFlow::Node trg) {
|
||||
exists(Base64::Encode encode | src = encode.getInput() and trg = encode.getOutput())
|
||||
or
|
||||
trg.(StringOps::ConcatenationRoot).getALeaf() = src and
|
||||
not exists(src.(StringOps::ConcatenationLeaf).getStringValue()) // to avoid e.g. the ":" in `user + ":" + pass` being flagged as a constant credential.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user