CWE-7

J2EE Misconfiguration: Missing Custom Error Page

Medium

Description

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

Potential Impact

How to Fix

Implementation

Handle exceptions appropriately in source code.

Implementation

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.

Implementation

Do not attempt to process an error or attempt to mask it.

Implementation

Verify return values are correct and do not supply sensitive information about the system.

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-7 vulnerabilities in your codebase.

Get Security Assessment