Skip to content

Commit 8a78075

Browse files
committed
Remove redundant method taint flow specifications
1 parent eda3d86 commit 8a78075

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

java/ql/src/experimental/Security/CWE/CWE-470/UnsafeReflection.ql

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,6 @@ class UnsafeReflectionConfig extends TaintTracking::Configuration {
7171
// Argument -> return of methods that look like `Object getInstance(Class c)`
7272
looksLikeInstantiateClassStep(pred, succ)
7373
or
74-
// Argument -> return of BeanFactory.getBean
75-
exists(MethodAccess ma, Method getBean, Expr argument |
76-
getBean.hasQualifiedName("org.springframework.beans.factory", "BeanFactory", "getBean") and
77-
(
78-
ma.getMethod().overrides(getBean)
79-
or
80-
ma.getMethod() = getBean
81-
) and
82-
argument = ma.getAnArgument() and
83-
(
84-
argument.getType() instanceof TypeString
85-
or
86-
argument.getType() instanceof TypeClass
87-
) and
88-
pred.asExpr() = argument and
89-
succ.asExpr() = ma
90-
)
91-
or
9274
// Qualifier -> return of Constructor.newInstance, Class.newInstance
9375
exists(NewInstance ni |
9476
ni.getQualifier() = pred.asExpr() and

java/ql/src/experimental/Security/CWE/CWE-470/UnsafeReflectionLib.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ predicate looksLikeInstantiateClassStep(DataFlow::Node fromNode, DataFlow::Node
5252
m = ma.getMethod() and arg = ma.getArgument(i)
5353
|
5454
m.getReturnType() instanceof TypeObject and
55-
m.getName()
56-
.toLowerCase()
57-
.regexpMatch("instantiate|instance|create|make|getbean|instantiateclass") and
55+
m.getName().toLowerCase().regexpMatch("instantiate|instance|create|make|getbean") and
5856
arg.getType() instanceof TypeClass and
5957
arg = fromNode.asExpr() and
6058
ma = toNode.asExpr()

0 commit comments

Comments
 (0)