Skip to content

Commit caf1d45

Browse files
authored
Merge pull request #9407 from erik-krogh/rubyFixJoin
RB: fix bad CP in the charPred for CipherOperation
2 parents 7c5a490 + 536d226 commit caf1d45

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ruby/ql/lib/codeql/ruby/security/OpenSSL.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,22 +528,23 @@ private class CipherNode extends DataFlow::Node {
528528
private class CipherOperation extends Cryptography::CryptographicOperation::Range,
529529
DataFlow::CallNode {
530530
private CipherNode cipherNode;
531-
private DataFlow::Node input;
532531

533532
CipherOperation() {
534533
// cipher instantiation is counted as a cipher operation with no input
535534
cipherNode = this and cipherNode instanceof CipherInstantiation
536535
or
537536
this.getReceiver() = cipherNode and
538-
this.getMethodName() = "update" and
539-
input = this.getArgument(0)
537+
this.getMethodName() = "update"
540538
}
541539

542540
override Cryptography::EncryptionAlgorithm getAlgorithm() {
543541
result = cipherNode.getCipher().getAlgorithm()
544542
}
545543

546-
override DataFlow::Node getAnInput() { result = input }
544+
override DataFlow::Node getAnInput() {
545+
this.getMethodName() = "update" and
546+
result = this.getArgument(0)
547+
}
547548

548549
override predicate isWeak() {
549550
cipherNode.getCipher().isWeak() or

0 commit comments

Comments
 (0)