From e87b8ba3d730d3a4dae40b77eb5340147365869d Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Mon, 31 Jul 2023 14:28:53 +0200 Subject: [PATCH] Java: Make the barrier in java/potentially-weak-cryptographic-algorithm less restrictive. --- .../java/security/MaybeBrokenCryptoAlgorithmQuery.qll | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/java/ql/lib/semmle/code/java/security/MaybeBrokenCryptoAlgorithmQuery.qll b/java/ql/lib/semmle/code/java/security/MaybeBrokenCryptoAlgorithmQuery.qll index 2cd4dcb7fe7..38f5ad08b7e 100644 --- a/java/ql/lib/semmle/code/java/security/MaybeBrokenCryptoAlgorithmQuery.qll +++ b/java/ql/lib/semmle/code/java/security/MaybeBrokenCryptoAlgorithmQuery.qll @@ -34,15 +34,6 @@ private predicate objectToString(MethodAccess ma) { ) } -private class StringContainer extends RefType { - StringContainer() { - this instanceof TypeString or - this instanceof StringBuildingType or - this.hasQualifiedName("java.util", "StringTokenizer") or - this.(Array).getComponentType() instanceof StringContainer - } -} - /** * A taint-tracking configuration to reason about the use of potentially insecure cryptographic algorithms. */ @@ -53,7 +44,7 @@ module InsecureCryptoConfig implements DataFlow::ConfigSig { predicate isBarrier(DataFlow::Node n) { objectToString(n.asExpr()) or - not n.getType().getErasure() instanceof StringContainer + n.getType().getErasure() instanceof TypeObject } }