One of the most important functions of error handling is that it must allow the application to fail securely. Applications should never display stack traces, server names, server IP, or other technical information to a user as this information can be used by a hacker in support of other attacks. Standard error pages should be used that display business appropriate error messages. For Struts based applications, it is recommended that an exception handler be created to work in conjunction with the error page. Consideration should also be given to logging all state information for the user, including the data in the request, session, and cookies, but remember that errors and exceptions must not compromise the application by exposing Personally Identifiable Information (PII). Special attention must be given to ensure that no PII is included in the logs. Just like a firewall should fail closed, an application should fail securely!
The following practices help secure your application's error handling:
- Do not leak information to the client
- Detailed error messages should be logged for all exceptions that are caught
- Ensure all open transactions are processed appropriately if an error is encountered during processing
- Error messages should be informative, but should not reveal information about system internals or other sensitive data, including PII
|
|
|
|