mirror of
https://github.com/github/codeql.git
synced 2026-05-11 01:39:28 +02:00
support credentials in a Buffer
This commit is contained in:
@@ -21,11 +21,17 @@ module HardcodedCredentials {
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
|
||||
|
||||
override predicate isAdditionalFlowStep(DataFlow::Node src, DataFlow::Node trg) {
|
||||
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.
|
||||
or
|
||||
exists(DataFlow::MethodCallNode bufferFrom |
|
||||
bufferFrom = DataFlow::globalVarRef("Buffer").getAMethodCall("from") and
|
||||
trg = bufferFrom and
|
||||
src = bufferFrom.getArgument(0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user