Skip to content

Commit 15da4ee

Browse files
authored
Merge pull request #13856 from aschackmull/java/maybebrokencrypto-barrier
Java: Make the barrier in java/potentially-weak-cryptographic-algorithm less restrictive
2 parents 9326fbd + e73e312 commit 15da4ee

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

java/ql/lib/semmle/code/java/security/MaybeBrokenCryptoAlgorithmQuery.qll

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ private predicate objectToString(MethodAccess ma) {
3434
)
3535
}
3636

37-
private class StringContainer extends RefType {
38-
StringContainer() {
39-
this instanceof TypeString or
40-
this instanceof StringBuildingType or
41-
this.hasQualifiedName("java.util", "StringTokenizer") or
42-
this.(Array).getComponentType() instanceof StringContainer
43-
}
44-
}
45-
4637
/**
4738
* A taint-tracking configuration to reason about the use of potentially insecure cryptographic algorithms.
4839
*/
@@ -53,7 +44,7 @@ module InsecureCryptoConfig implements DataFlow::ConfigSig {
5344

5445
predicate isBarrier(DataFlow::Node n) {
5546
objectToString(n.asExpr()) or
56-
not n.getType().getErasure() instanceof StringContainer
47+
n.getType().getErasure() instanceof TypeObject
5748
}
5849
}
5950

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The sanitizer in `java/potentially-weak-cryptographic-algorithm` has been improved, so the query may yield additional results.

0 commit comments

Comments
 (0)