The default error page of a web application should not display sensitive information about the product.
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.
Verify return values are correct and do not supply sensitive information about the system.
Our security experts can help you identify and remediate CWE-7 vulnerabilities in your codebase.
Get Security Assessment