From 551c55db400d41df30199ab9dce7557424273e93 Mon Sep 17 00:00:00 2001 From: Mark C Date: Thu, 27 Jul 2023 23:21:26 +0100 Subject: [PATCH 1/2] Update Encryption.qll in line with NIST.SP.800-131Ar2 --- java/ql/lib/semmle/code/java/security/Encryption.qll | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/ql/lib/semmle/code/java/security/Encryption.qll b/java/ql/lib/semmle/code/java/security/Encryption.qll index 88a1996ffd9a..66eaf4fa223d 100644 --- a/java/ql/lib/semmle/code/java/security/Encryption.qll +++ b/java/ql/lib/semmle/code/java/security/Encryption.qll @@ -230,7 +230,10 @@ string getAnInsecureAlgorithmName() { // Encryption mode ECB like AES/ECB/NoPadding is vulnerable to replay and other attacks "ECB", // CBC mode of operation with PKCS#5 or PKCS#7 padding is vulnerable to padding oracle attacks - "AES/CBC/PKCS[57]Padding" + "AES/CBC/PKCS[57]Padding", + // As of NIST.SP.800-131Ar2, 2TDES, 3TDES, and SKIPJACK are no longer supported, deprectated effective end 2023. + // "DESede", "TripleDES", "3DES" are all 3TDEA depending on which library (BC, JCE, JSSE etc.) + "DESede", "TripleDES", "3DES" , "SKIPJACK", "Skipjack" ] } From ba8f95f9d3f8070284214a2ec4b5176a22d9b287 Mon Sep 17 00:00:00 2001 From: Mark C Date: Fri, 28 Jul 2023 10:37:28 +0100 Subject: [PATCH 2/2] Add ChaCha20 and ChaCha20Poly1305 to the list of StrongAlgos --- java/ql/lib/semmle/code/java/security/Encryption.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/ql/lib/semmle/code/java/security/Encryption.qll b/java/ql/lib/semmle/code/java/security/Encryption.qll index 66eaf4fa223d..555dec7a7394 100644 --- a/java/ql/lib/semmle/code/java/security/Encryption.qll +++ b/java/ql/lib/semmle/code/java/security/Encryption.qll @@ -273,8 +273,8 @@ string getInsecureAlgorithmRegex() { string getASecureAlgorithmName() { result = [ - "RSA", "SHA256", "SHA512", "CCM", "GCM", "AES(?![^a-zA-Z](ECB|CBC/PKCS[57]Padding))", - "Blowfish", "ECIES" + "RSA", "SHA256", "SHA512", "CCM", "GCM", "Blowfish", "AES(?![^a-zA-Z](ECB|CBC/PKCS[57]Padding))", + "(ChaCha20Poly1305|ChaCha20)", "ECIES" ] }