Failure to Catch All Exceptions in Servlet |
Weakness ID: 600 (Weakness Base) | Status: Draft |
Description Summary
A Servlet fails to catch all exceptions, which may reveal sensitive debugging information.
Extended Description
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.
Example 1
In the following method a DNS lookup failure will cause the Servlet to throw an exception.
(Bad Code)
Example Language: Java
protected void doPost (HttpServletRequest req, HttpServletResponse res) throws IOException {
String ip = req.getRemoteAddr();
InetAddress addr = InetAddress.getByName(ip);
...
out.println("hello " + addr.getHostName());
}
Nature | Type | ID | Name | View(s) this relationship pertains to![]() |
---|---|---|---|---|
ChildOf | ![]() | 388 | Error Handling | Development Concepts (primary)699 |
ChildOf | ![]() | 691 | Insufficient Control Flow Management | Research Concepts1000 |
ChildOf | ![]() | 755 | Improper Handling of Exceptional Conditions | Research Concepts (primary)1000 |
CanPrecede | ![]() | 209 | Information Exposure Through an Error Message | Research Concepts1000 |
PeerOf | ![]() | 390 | Detection of Error Condition Without Action | Research Concepts1000 |
The "Missing Catch Block" concept is probably broader than just Servlets, but the broader concept is not sufficiently covered in CWE. |
Modifications | ||||
---|---|---|---|---|
Modification Date | Modifier | Organization | Source | |
2008-07-01 | Eric Dalci | Cigital | External | |
updated Potential Mitigations, Time of Introduction | ||||
2008-09-08 | CWE Content Team | MITRE | Internal | |
updated Relationships, Other Notes | ||||
2009-03-10 | CWE Content Team | MITRE | Internal | |
updated Alternate Terms, Description, Maintenance Notes, Name, Other Notes, Relationships | ||||
2009-05-27 | CWE Content Team | MITRE | Internal | |
updated Demonstrative Examples | ||||
Previous Entry Names | ||||
Change Date | Previous Entry Name | |||
2008-04-11 | Missing Catch Block | |||
2009-03-10 | Failure to Catch All Exceptions (Missing Catch Block) | |||