mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Sensitive GET Query
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
edges
|
||||
| SensitiveGetQuery.java:12:38:12:45 | password : String | SensitiveGetQuery.java:12:22:12:45 | ... + ... |
|
||||
nodes
|
||||
| SensitiveGetQuery.java:12:22:12:45 | ... + ... | semmle.label | ... + ... |
|
||||
| SensitiveGetQuery.java:12:38:12:45 | password : String | semmle.label | password : String |
|
||||
#select
|
||||
| SensitiveGetQuery.java:12:22:12:45 | ... + ... | SensitiveGetQuery.java:12:38:12:45 | password : String | SensitiveGetQuery.java:12:22:12:45 | ... + ... | $@ uses GET request method with sensitive information. | SensitiveGetQuery.java:12:38:12:45 | password | sensitive query string |
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
public class SensitiveGetQuery extends HttpServlet {
|
||||
// BAD - Tests sending sensitive information in a GET request.
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
|
||||
String password = request.getParameter("password");
|
||||
System.out.println("password = " + password);
|
||||
}
|
||||
|
||||
// GOOD - Tests sending sensitive information in a POST request.
|
||||
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
|
||||
String password = request.getParameter("password");
|
||||
System.out.println("password = " + password);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
experimental/Security/CWE/CWE-598/SensitiveGetQuery.ql
|
||||
@@ -0,0 +1 @@
|
||||
// semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/servlet-api-2.4
|
||||
Reference in New Issue
Block a user