mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Java: Fix FP in UseSSL.
This commit is contained in:
14
java/ql/test/query-tests/security/CWE-311/CWE-319/Test.java
Normal file
14
java/ql/test/query-tests/security/CWE-311/CWE-319/Test.java
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
| Test.java:11:15:11:41 | getInputStream(...) | Stream using vulnerable non-SSL connection. |
|
||||
@@ -0,0 +1 @@
|
||||
Security/CWE/CWE-319/UseSSL.ql
|
||||
Reference in New Issue
Block a user