Skip to content

Commit c35fbf9

Browse files
committed
Add more sanitizers
1 parent 3c6c09b commit c35fbf9

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,25 @@ private class ArrayUpdate extends Expr {
5454
ma = this and
5555
ma.getArgument(0) = array
5656
|
57-
m.hasQualifiedName("java.io", "InputStream", "read") or
57+
m.getAnOverride*().hasQualifiedName("java.io", ["InputStream", "RandomAccessFile"], "read") or
58+
m.getAnOverride*().hasQualifiedName("java.io", "DataInput", "readFully") or
5859
m.hasQualifiedName("java.nio", "ByteBuffer", "get") or
5960
m.hasQualifiedName("java.security", "SecureRandom", "nextBytes") or
60-
m.hasQualifiedName("java.util", "Random", "nextBytes")
61+
m.hasQualifiedName("java.util", "Random", "nextBytes") or
62+
m.hasQualifiedName("java.util.zip", "Inflater", "inflate") or
63+
m.hasQualifiedName("io.netty.buffer", "ByteBuf", "readBytes") or
64+
m.getAnOverride*().hasQualifiedName("org.bouncycastle.crypto", "Digest", "doFinal")
65+
)
66+
or
67+
exists(MethodAccess ma, Method m |
68+
m = ma.getMethod() and
69+
ma = this and
70+
ma.getArgument(1) = array
71+
|
72+
m.hasQualifiedName("org.apache.commons.io", "IOUtils", ["read", "readFully"]) or
73+
m.hasQualifiedName("io.netty.buffer", "ByteBuf", "getBytes") or
74+
m.hasQualifiedName("org.bouncycastle.crypto.generators",
75+
any(string s | s.matches("%BytesGenerator")), "generateBytes")
6176
)
6277
}
6378

0 commit comments

Comments
 (0)