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

@@ -0,0 +1,14 @@
import java.net.HttpURLConnection;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
class Test {
public void m1(HttpURLConnection connection) {
InputStream input;
if (connection instanceof HttpsURLConnection) {
input = connection.getInputStream(); // OK
} else {
input = connection.getInputStream(); // BAD
}
}
}

View File

@@ -0,0 +1 @@
| Test.java:11:15:11:41 | getInputStream(...) | Stream using vulnerable non-SSL connection. |

View File

@@ -0,0 +1 @@
Security/CWE/CWE-319/UseSSL.ql