Missing Handler |
Weakness ID: 431 (Weakness Base) | Status: Draft |
Example 1
If a Servlet fails to catch all exceptions, it may reveal debugging information that will help an adversary form a plan of attack. 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());
}
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.
Handle all possible situations (e.g. error condition). |
If an operation can throw an Exception, implement a handler for that specific exception. |
When an exception is thrown and not caught, the process has given up an opportunity to decide if a given failure or event is worth a change in execution. |
Nature | Type | ID | Name | View(s) this relationship pertains to![]() |
---|---|---|---|---|
ChildOf | ![]() | 429 | Handler Errors | Development Concepts (primary)699 |
ChildOf | ![]() | 691 | Insufficient Control Flow Management | Research Concepts (primary)1000 |
CanPrecede | ![]() | 433 | Unparsed Raw Web Content Delivery | Research Concepts1000 |
Submissions | ||||
---|---|---|---|---|
Submission Date | Submitter | Organization | Source | |
PLOVER | Externally Mined | |||
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, Taxonomy Mappings | ||||
2009-05-27 | CWE Content Team | MITRE | Internal | |
updated Demonstrative Examples |