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"

From OWASP
Jump to: navigation, search
Line 1: Line 1:
{{Template:Vulnerability}}
+
{{template:CandidateForDeletion}}
{{Template:Fortify}}
+
#REDIRECT [[Information Leakage]]
  
 
__TOC__
 
__TOC__
Line 8: Line 8:
  
 
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
 
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
 
 
[[Category:FIXME|This is the text from the old template. This needs to be rewritten using the new template.]]
 
  
  
Line 92: Line 89:
  
 
TBD
 
TBD
[[Category:FIXME|add links
 
 
In addition, one should classify vulnerability based on the following subcategories: Ex:<nowiki>[[Category:Error Handling Vulnerability]]</nowiki>
 
 
Availability Vulnerability
 
 
Authorization Vulnerability
 
 
Authentication Vulnerability
 
 
Concurrency Vulnerability
 
 
Configuration Vulnerability
 
 
Cryptographic Vulnerability
 
 
Encoding Vulnerability
 
 
Error Handling Vulnerability
 
 
Input Validation Vulnerability
 
 
Logging and Auditing Vulnerability
 
 
Session Management Vulnerability]]
 
 
__NOTOC__
 
 
 
[[Category:OWASP ASDR Project]]
 
[[Category:Error Handling Vulnerability]]
 
[[Category:Java]]
 
[[Category:Implementation]]
 
[[Category:Code Snippet]]
 
[[Category:Servlet]]
 
[[Category:Vulnerability]]
 

Revision as of 18:01, 10 February 2009

Template:CandidateForDeletion

#REDIRECT Information Leakage

ASDR Table of Contents


Last revision (mm/dd/yy): 02/10/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