Java: Add org.apache.commons.codec.(De|En)coder to TainTrackingUtil

The commons codec library contains many encoder and decoder methods
and is fairly commonly used.
This commit is contained in:
Arthur Baars
2020-03-25 16:16:49 +01:00
parent fcc2b66d1a
commit 9742d3892d

View File

@@ -434,7 +434,15 @@ private predicate taintPreservingArgumentToMethod(Method method, int arg) {
or
(
method.getDeclaringType().hasQualifiedName("java.util", "Base64$Encoder") or
method.getDeclaringType().hasQualifiedName("java.util", "Base64$Decoder")
method.getDeclaringType().hasQualifiedName("java.util", "Base64$Decoder") or
method
.getDeclaringType()
.getASupertype*()
.hasQualifiedName("org.apache.commons.codec", "Encoder") or
method
.getDeclaringType()
.getASupertype*()
.hasQualifiedName("org.apache.commons.codec", "Decoder")
) and
(
method.getName() = "encode" and arg = 0 and method.getNumberOfParameters() = 1