CWE-209: Generation of Error Message Containing Sensitive Information
low-riskThe product generates an error message that includes sensitive information about its environment, users, or associated data.
Common Consequences
Detection Methods
This weakness generally requires domain-specific interpretation using manual analysis. However, the number of potential error conditions may be too large to cover completely within limited time constraints.
Automated methods may be able to detect certain idioms automatically, such as exposed stack traces or pathnames, but violation of business rules or privacy requirements is not typically feasible.
This weakness can be detected using dynamic tools and techniques that interact with the software using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The software's operation may slow down, but it should not become unstable, crash, or generate incorrect results. Error conditions may be triggered with a stress-test by calling the software simultaneously from a large number of threads or processes, and look for evidence of any unexpected behavior.
Identify error conditions that are not likely to occur during normal usage and trigger them. For example, run the program under low memory conditions, run with insufficient privileges or permissions, interrupt a transaction before it is completed, or disable connectivity to basic network services such as DNS. Monitor the software for any unexpected behavior. If you trigger an unhandled exception or similar error that was discovered and handled by the application's environment, it may still indicate unexpected conditions that were not handled by the application itself.
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Real-World Examples (10)
| CVE | CVSS | EPSS | KEV |
|---|---|---|---|
| CVE-2024-29059 | 7.5 | 93.8% | Y |
| CVE-2024-29059 | 7.5 | 93.8% | Y |
| CVE-2023-27587 | 7.4 | 87.5% | — |
| CVE-2024-45440 | 5.3 | 87.2% | — |
| CVE-2024-45440 | 5.3 | 87.2% | — |
| CVE-2013-7331 | 6.5 | 81.8% | Y |
| CVE-2024-21733 | 5.3 | 73.4% | — |
| CVE-2021-22145 | 6.5 | 67.9% | — |
| CVE-2024-39719 | 7.5 | 39.2% | — |
| CVE-2022-29266 | 7.5 | 35.8% | — |