Description
The Servlet does not catch all exceptions, which may reveal sensitive debugging information.
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.
Potential Impact
Confidentiality, Availability
Read Application Data, DoS: Crash, Exit, or Restart
Demonstrative Examples
protected void doPost (HttpServletRequest req, HttpServletResponse res) throws IOException {String ip = req.getRemoteAddr();InetAddress addr = InetAddress.getByName(ip);...out.println("hello " + addr.getHostName());}Mitigations & Prevention
Implement Exception blocks to handle all types of Exceptions.
Related Weaknesses
Taxonomy Mappings
- The CERT Oracle Secure Coding Standard for Java (2011): ERR01-J — Do not allow exceptions to expose sensitive information
- Software Fault Patterns: SFP4 — Unchecked Status Condition
Frequently Asked Questions
What is CWE-600?
CWE-600 (Uncaught Exception in Servlet) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Variant-level weakness. The Servlet does not catch all exceptions, which may reveal sensitive debugging information.
How can CWE-600 be exploited?
Attackers can exploit CWE-600 (Uncaught Exception in Servlet) to read application data, dos: crash, exit, or restart. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-600?
Key mitigations include: Implement Exception blocks to handle all types of Exceptions.
What is the severity of CWE-600?
CWE-600 is classified as a Variant-level weakness (Low-Medium abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.