Fail Securely
Fail securely means implementing decision logic that puts systems into a secure state when errors occur. Handling errors securely ensures that the error path, such as exceptions, doesnβt disclose additional information that would not be available otherwise. Attackers can use this additional information to learn how to attack the system.
Here are some best practices.
- Don't use an error message that discloses information about the web server configuration because it can help an attacker identify potential weaknesses.
- Use a generic βusername and/or passphrase is invalidβ message instead of βusername not foundβ or βpassword is incorrectβ to prevent user enumeration.