Change to ServletResponse type and fix formatting error

This commit is contained in:
luchua-bc
2020-07-02 12:49:25 +00:00
parent 1d0232b464
commit a61f814b4b
2 changed files with 3 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
<qhelp>
<overview>
<p>
Even though the signatures for methods in a servlet include `throws IOException, ServletException`, it's a bad idea to let such exceptions be thrown. Failure to catch exceptions in a servlet could leave a system in a vulnerable state, possibly resulting in denial-of-service attacks, or the exposure of sensitive information because when a servlet throws an exception, the servlet container typically sends debugging information back to the user. And that information could be very valuable to an attacker.
Even though the signatures for methods in a servlet include <code>throws IOException, ServletException</code>, it's a bad idea to let such exceptions be thrown. Failure to catch exceptions in a servlet could leave a system in a vulnerable state, possibly resulting in denial-of-service attacks, or the exposure of sensitive information because when a servlet throws an exception, the servlet container typically sends debugging information back to the user. And that information could be very valuable to an attacker.
</p>
</overview>

View File

@@ -27,11 +27,11 @@ private predicate catchesEx(TryStmt t, RefType exType) {
)
}
/** Servlet methods of `javax.servlet.http.HttpServlet`. */
/** Servlet methods of `javax.servlet.http.Servlet` and subtypes. */
private predicate isServletMethod(Callable c) {
c.getDeclaringType() instanceof ServletClass and
c.getNumberOfParameters() = 2 and
c.getParameter(1).getType() instanceof HttpServletResponse and
c.getParameter(1).getType() instanceof ServletResponse and
(
c.getName() = "doGet" or
c.getName() = "doPost" or