mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Change to ServletResponse type and fix formatting error
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user