This weakness occurs when code catches a generic exception type like 'Exception' or 'Throwable', which can hide specific errors and create insecure error handling logic.
While it may seem cleaner to catch a broad exception like 'Exception' instead of writing multiple specific catch blocks, this practice is risky. It masks the true nature of errors, preventing you from handling different failure scenarios appropriately. Exceptions that deserve special recovery logic, or that shouldn't be caught at that point in the program, get lumped together and ignored. As your application evolves and starts throwing new, more specific exception types, this broad catch will silently swallow them all. This defeats the core purpose of a typed exception system, making your code less robust and secure over time. It often leads to complex, bug-prone error handling that can introduce vulnerabilities, as critical failures go unnoticed and unlogged.
Impact: Hide Activities
A generic exception can hide details about unexpected adversary activities by making it difficult to properly troubleshoot error conditions during execution.
javajava