This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "System Information Leak: Missing Catch Block"
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{template:CandidateForDeletion}} |
− | + | #REDIRECT [[Information Leakage]] | |
+ | |||
− | |||
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' | Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 91: | Line 86: | ||
TBD | TBD | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 23:30, 7 April 2009
#REDIRECT Information Leakage
Last revision (mm/dd/yy): 04/7/2009
Description
If a Servlet fails to catch all exceptions, it may reveal debugging information that will help an adversary form a plan of attack.
When a Servlet throws an exception, the default error response the Servlet container sends back to the user typically includes debugging information. This information is of great value to an attacker. For example, a stack trace might show the attacker a malformed SQL query string, the type of database being used, and the version of the application container. This information enables the attacker to target known vulnerabilities in these components.
Risk Factors
TBD
Examples
Example 1
In the following method a DNS lookup failure will cause the Servlet to throw an exception.
protected void doPost (HttpServletRequest req, HttpServletResponse res) throws IOException { String ip = req.getRemoteAddr(); InetAddress addr = InetAddress.getByName(ip); ... out.println("hello " + addr.getHostName()); }
Example 2
The following method will throw a NullPointerException if the parameter "name" is not part of the request.
protected void doPost (HttpServletRequest req, HttpServletResponse res) throws IOException { String name = getParameter("name"); ... out.println("hello " + name.trim()); }
Related Attacks
Related Vulnerabilities
Related Controls
A good error handling mechanism always tries to capture all exceptions and returns a generic error message that does not reveal any details about the error and the application. Depending on the platform and container the application is running on, there can be different options.
- Set a generic custom error page for all unhandled exceptions at the container level. (Normally, this is set in the configuration file.) The generic custom error page should have a simple error message that does not reveal any details about the exception happened.
- In ASP.NET, it is the customError tag in the web.config file
- Use an global error handler to capture all unhandled exceptions.
- In ASP.NET, it is the Application_Error sub in the global.asax file.
- Handle the error in the page level
- In ASP.NET, it is the Page_Error sub on the aspx page or associated codebehind page
Related Technical Impacts
References
TBD