File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
java/ql/lib/semmle/code/java/security Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,8 @@ predicate trustedDomain(string domainName) {
6161 */
6262private predicate trustedSocketFactory ( MethodAccess setSocketFactory , boolean default ) {
6363 exists ( MethodAccess getSocketFactory , MethodAccess initSslContext |
64- exists ( Method m | setSocketFactory .getMethod ( ) .getASourceOverriddenMethod * ( ) = m |
65- default = true and
66- m .getDeclaringType ( ) instanceof HttpsUrlConnection and
67- m .hasName ( "setDefaultSSLSocketFactory" )
64+ exists ( Method m | setSocketFactory .getMethod ( ) = m |
65+ default = true and m instanceof SetDefaultConnectionFactoryMethod
6866 or
6967 default = false and m instanceof SetConnectionFactoryMethod
7068 ) and
Original file line number Diff line number Diff line change @@ -150,6 +150,13 @@ class SetConnectionFactoryMethod extends Method {
150150 }
151151}
152152
153+ class SetDefaultConnectionFactoryMethod extends Method {
154+ SetDefaultConnectionFactoryMethod ( ) {
155+ this .hasName ( "setDefaultSSLSocketFactory" ) and
156+ this .getDeclaringType ( ) .getAnAncestor ( ) instanceof HttpsUrlConnection
157+ }
158+ }
159+
153160class SetHostnameVerifierMethod extends Method {
154161 SetHostnameVerifierMethod ( ) {
155162 this .hasName ( "setHostnameVerifier" ) and
You can’t perform that action at this time.
0 commit comments