In many cases, an attacker can leverage the conditions that cause unhandled exception errors in order to gain unauthorized access to the system.
Impact: Read Application Data
java
/* Assume appropriate validation / encoding is used and privileges / permissions are preserved / }
java
java
// Get username and password from login page request* String username = request.getParameter("username"); String password = request.getParameter("password");
java
java
// output failed login message to error page* request.setAttribute("error", new String("Login Error")); request.setAttribute("message", ex.getMessage()); getServletContext().getRequestDispatcher("/ErrorPage.jsp").forward(request, response);}}