Skip to content

Commit 56e3b30

Browse files
committed
Resolve ambiguous method access
1 parent 2f17943 commit 56e3b30

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

java/ql/src/experimental/Security/CWE/CWE-598/SensitiveGetQuery.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ class SensitiveInfoExpr extends Expr {
2424
}
2525

2626
/** Holds if `m` is a method of some override of `HttpServlet.doGet`. */
27-
private predicate isGetServletMethod(Method m) { isServletMethod(m) and m.getName() = "doGet" }
27+
private predicate isGetServletMethod(Method m) {
28+
isServletRequestMethod(m) and m.getName() = "doGet"
29+
}
2830

2931
/** The `doGet` method of `HttpServlet`. */
3032
class DoGetServletMethod extends Method {
@@ -63,7 +65,7 @@ class SensitiveGetQueryConfiguration extends TaintTracking::Configuration {
6365

6466
/** Holds if the node is in a servlet method other than `doGet`. */
6567
override predicate isSanitizer(DataFlow::Node node) {
66-
isServletMethod(node.getEnclosingCallable()) and
68+
isServletRequestMethod(node.getEnclosingCallable()) and
6769
not isGetServletMethod(node.getEnclosingCallable())
6870
}
6971
}

java/ql/src/semmle/code/java/frameworks/Servlets.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class ServletWebXMLListenerType extends RefType {
324324
}
325325

326326
/** Holds if `m` is a request handler method (for example `doGet` or `doPost`). */
327-
predicate isServletMethod(Method m) {
327+
predicate isServletRequestMethod(Method m) {
328328
m.getDeclaringType() instanceof ServletClass and
329329
m.getNumberOfParameters() = 2 and
330330
m.getParameter(0).getType() instanceof ServletRequest and

0 commit comments

Comments
 (0)