@@ -44,9 +44,8 @@ private class CertificateException extends RefType {
44
44
* - `m` calls a method declared to throw a `CertificateException`, but for which no source is available
45
45
*/
46
46
private predicate mayThrowCertificateException ( Method m ) {
47
- exists ( Stmt stmt | m .getBody ( ) .getAChild * ( ) = stmt |
48
- stmt .( ThrowStmt ) .getThrownExceptionType ( ) .getASupertype * ( ) instanceof CertificateException
49
- )
47
+ m .getBody ( ) .getAChild * ( ) .( ThrowStmt ) .getThrownExceptionType ( ) .getASupertype * ( ) instanceof
48
+ CertificateException
50
49
or
51
50
exists ( Method otherMethod | m .polyCalls ( otherMethod ) |
52
51
mayThrowCertificateException ( otherMethod )
@@ -75,31 +74,6 @@ class InsecureTrustManagerConfiguration extends TaintTracking::Configuration {
75
74
ma .getArgument ( 1 ) = sink .asExpr ( )
76
75
)
77
76
}
78
-
79
- override predicate isSanitizer ( DataFlow:: Node barrier ) {
80
- // ignore nodes that are in functions that intentionally trust all certificates
81
- barrier
82
- .getEnclosingCallable ( )
83
- .getName ( )
84
- /*
85
- * Regex: (_)* :
86
- * some methods have underscores.
87
- * Regex: (no|ignore|disable)(strictssl|ssl|verify|verification)
88
- * noStrictSSL ignoreSsl
89
- * Regex: (set)?(accept|trust|ignore|allow)(all|every|any|selfsigned)
90
- * acceptAll trustAll ignoreAll setTrustAnyHttps
91
- * Regex: (use|do|enable)insecure
92
- * useInsecureSSL
93
- * Regex: (set|do|use)?no.*(check|validation|verify|verification)
94
- * setNoCertificateCheck
95
- * Regex: disable
96
- * disableChecks
97
- */
98
-
99
- .regexpMatch ( "^(?i)(_)*((no|ignore|disable)(strictssl|ssl|verify|verification)" +
100
- "|(set)?(accept|trust|ignore|allow)(all|every|any|selfsigned)" +
101
- "|(use|do|enable)insecure|(set|do|use)?no.*(check|validation|verify|verification)|disable).*$" )
102
- }
103
77
}
104
78
105
79
bindingset [ result ]
@@ -139,7 +113,12 @@ private predicate isFlag(DataFlow::Node source) {
139
113
)
140
114
}
141
115
142
- /** Holds if there is flow from `node1` to `node2` either due to local flow or due to custom flow steps. */
116
+ /**
117
+ * Holds if there is flow from `node1` to `node2` either due to local flow or due to custom flow steps:
118
+ * 1. `Boolean.parseBoolean(taintedValue)` taints the return value of `parseBoolean`.
119
+ * 2. A call to an `EnvReadMethod` such as `System.getProperty` where a tainted value is used as an argument.
120
+ * The return value of such a method is then tainted.
121
+ */
143
122
private predicate flagFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
144
123
DataFlow:: localFlowStep ( node1 , node2 )
145
124
or
0 commit comments