CWE-665: Improper Initialization

low-risk

The product does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used.

Abstraction: Class

Common Consequences

Confidentiality Read Memory
Access Control Bypass Protection Mechanism
Availability DoS: Crash, Exit, or Restart

Detection Methods

Automated Dynamic Analysis

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. Initialization problems may be detected 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. The software's operation may slow down, but it should not become unstable, crash, or generate incorrect results.

Manual Dynamic Analysis

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

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-2023-1719 7.5 86.1%
CVE-2023-1719 7.5 86.1%
CVE-2022-0847 7.8 81.6% Y
CVE-2022-0847 7.8 81.6% Y
CVE-2019-14271 9.8 72.2%
CVE-2022-46164 9.4 56.8%
CVE-2020-27950 5.5 36.6% Y
CVE-2020-27950 5.5 36.6% Y
CVE-2022-22719 7.5 29.4%
CVE-2022-22719 7.5 29.4%
9
/ 100
low-risk
Active Threat 7/50 · Minimal
Exploit Availability 2/50 · Minimal