mirror of
https://github.com/github/codeql.git
synced 2026-02-27 20:33:42 +01:00
Merge pull request #4880 from luchua-bc/java/sensitive-query-with-get
Java: Sensitive GET Query
This commit is contained in:
@@ -322,3 +322,18 @@ class ServletWebXMLListenerType extends RefType {
|
||||
// - `HttpSessionBindingListener`
|
||||
}
|
||||
}
|
||||
|
||||
/** Holds if `m` is a request handler method (for example `doGet` or `doPost`). */
|
||||
predicate isServletRequestMethod(Method m) {
|
||||
m.getDeclaringType() instanceof ServletClass and
|
||||
m.getNumberOfParameters() = 2 and
|
||||
m.getParameter(0).getType() instanceof ServletRequest and
|
||||
m.getParameter(1).getType() instanceof ServletResponse
|
||||
}
|
||||
|
||||
/** Holds if `ma` is a call that gets a request parameter. */
|
||||
predicate isRequestGetParamMethod(MethodAccess ma) {
|
||||
ma.getMethod() instanceof ServletRequestGetParameterMethod or
|
||||
ma.getMethod() instanceof ServletRequestGetParameterMapMethod or
|
||||
ma.getMethod() instanceof HttpServletRequestGetQueryStringMethod
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user