Information Leak Through Servlet Runtime Error Message |
Weakness ID: 536 (Weakness Variant) | Status: Incomplete |
Description Summary
A servlet error message indicates that there exists an unhandled exception in your web application code and may provide useful information to an attacker.
Scope | Effect |
---|---|
Confidentiality Access Control | In many cases, an attacker can leverage the conditions that cause these errors in order to gain unauthorized access to the system. |
Example 1
The following servlet code does not catch runtime exceptions, meaning that if such an exception were to occur, the container may display potentially dangerous information (such as a full stack trace).
(Bad Code)
Example Language: Java
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String username = request.getParameter("username");
// May cause unchecked NullPointerException.
if (username.length() < 10) {
...
}
}
The error message may contain the location of the file in which the offending function is located. This may disclose the web root's absolute path as well as give the attacker the location of application include files or configuration information. It may even disclose the portion of code that failed. |
Nature | Type | ID | Name | View(s) this relationship pertains to![]() |
---|---|---|---|---|
ChildOf | ![]() | 210 | Product-Generated Error Message Information Leak | Development Concepts (primary)699 Research Concepts (primary)1000 |
Submissions | ||||
---|---|---|---|---|
Submission Date | Submitter | Organization | Source | |
Anonymous Tool Vendor (under NDA) | Externally Mined | |||
Modifications | ||||
Modification Date | Modifier | Organization | Source | |
2008-07-01 | Sean Eidemiller | Cigital | External | |
added/updated demonstrative examples | ||||
2008-07-01 | Eric Dalci | Cigital | External | |
updated Potential Mitigations, Time of Introduction | ||||
2008-09-08 | CWE Content Team | MITRE | Internal | |
updated Common Consequences, Relationships, Other Notes, Taxonomy Mappings | ||||
2009-10-29 | CWE Content Team | MITRE | Internal | |
updated Common Consequences |