Merge pull request #611 from aschackmull/java/usessl-fp-fix

Java: Fix FP in `UseSSL.ql`.
This commit is contained in:
yh-semmle
2018-12-04 19:31:53 -05:00
committed by GitHub
4 changed files with 23 additions and 2 deletions

View File

@@ -10,6 +10,7 @@
*/
import java
import semmle.code.java.dataflow.TypeFlow
import semmle.code.java.security.Encryption
class URLConnection extends RefType {
@@ -27,11 +28,15 @@ from MethodAccess m, Class c, string type
where
m.getQualifier().getType() = c and
(
(c instanceof URLConnection and type = "connection")
c instanceof URLConnection and type = "connection"
or
(c instanceof Socket and type = "socket")
c instanceof Socket and type = "socket"
) and
not c instanceof SSLClass and
not exists(RefType t |
exprTypeFlow(m.getQualifier(), t, _) and
t instanceof SSLClass
) and
(
m.getMethod().getName() = "getInputStream" or
m.getMethod().getName() = "getOutputStream"