@@ -80,7 +80,8 @@ class InsecureTrustManagerConfiguration extends TaintTracking::Configuration {
80
80
bindingset [ result ]
81
81
private string getAFlagName ( ) {
82
82
result
83
- .regexpMatch ( "(?i).*(secure|disable|selfCert|selfSign|validat|verif|trust|ignore|nocertificatecheck).*" )
83
+ .regexpMatch ( "(?i).*(secure|disable|selfCert|selfSign|validat|verif|trust|ignore|nocertificatecheck).*" ) and
84
+ result != "equalsIgnoreCase"
84
85
}
85
86
86
87
/**
@@ -94,11 +95,6 @@ private class FlagType extends Type {
94
95
}
95
96
}
96
97
97
- private predicate isEqualsIgnoreCaseMethodAccess ( MethodAccess ma ) {
98
- ma .getMethod ( ) .hasName ( "equalsIgnoreCase" ) and
99
- ma .getMethod ( ) .getDeclaringType ( ) instanceof TypeString
100
- }
101
-
102
98
/** Holds if `source` should is considered a flag. */
103
99
private predicate isFlag ( DataFlow:: Node source ) {
104
100
exists ( VarAccess v | v .getVariable ( ) .getName ( ) = getAFlagName ( ) |
@@ -109,13 +105,13 @@ private predicate isFlag(DataFlow::Node source) {
109
105
or
110
106
exists ( MethodAccess ma | ma .getMethod ( ) .getName ( ) = getAFlagName ( ) |
111
107
source .asExpr ( ) = ma and
112
- ma .getType ( ) instanceof FlagType and
113
- not isEqualsIgnoreCaseMethodAccess ( ma )
108
+ ma .getType ( ) instanceof FlagType
114
109
)
115
110
}
116
111
117
112
/**
118
- * Holds if there is flow from `node1` to `node2` either due to local flow or due to custom flow steps:
113
+ * Holds if there is local flow from `node1` to `node2` either due to standard data-flow steps or the
114
+ * following custom flow steps:
119
115
* 1. `Boolean.parseBoolean(taintedValue)` taints the return value of `parseBoolean`.
120
116
* 2. A call to an `EnvReadMethod` such as `System.getProperty` where a tainted value is used as an argument.
121
117
* The return value of such a method is then tainted.
0 commit comments