CWE-7: J2EE Misconfiguration: Missing Custom Error Page

VariantIncomplete

The default error page of a web application should not display sensitive information about the product.

View on MITRE
Back to CWE Lookup

Extended Description

A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response. When an attacker explores a web site looking for vulnerabilities, the amount of information that the site provides is crucial to the eventual success or failure of any attempted attacks.

Technical Details

Structure
Simple

Applicable To

Languages
Java
Platforms

Frequently Asked Questions

What is CWE-7: J2EE Misconfiguration: Missing Custom Error Page?+

CWE-7: J2EE Misconfiguration: Missing Custom Error Page is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The default error page of a web application should not display sensitive information about the product. A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response. When an attacker explores a web site looking for vulnerabilities, the amount of information that the site provides is crucial to the eventual success or failure of any attempted attacks.

What are the security consequences of J2EE Misconfiguration: Missing Custom Error Page?+

If exploited, CWE-7 (J2EE Misconfiguration: Missing Custom Error Page) it can compromise Confidentiality, leading to outcomes such as Read Application Data.

How do you prevent or mitigate J2EE Misconfiguration: Missing Custom Error Page?+

Recommended mitigations for CWE-7 include: Handle exceptions appropriately in source code. Always define appropriate error pages. The application configuration should specify a default error page in order to guarantee that the application will never leak error messages to an attacker. Handling standard HTTP error codes is useful and user-friendly in addition to being a good security practice, and a good configuration will also define a last-chance error handler that catches any exception that could possibly be thrown by the application. Do not attempt to process an error or attempt to mask it.

Which programming languages are affected by J2EE Misconfiguration: Missing Custom Error Page?+

CWE-7 commonly affects Java. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-7 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More