add support for string concatenations and base64-encoding of hardcoded credentials

This commit is contained in:
Erik Krogh Kristensen
2020-06-02 23:15:13 +02:00
parent b6dc94fccb
commit 3c802007a3
3 changed files with 40 additions and 11 deletions

View File

@@ -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.
}
}
}