What it is
The code uses a variable that has not been initialized, leading to unpredictable or unintended results.
Impact on systems
| Scope | Impact |
|---|---|
| Confidentiality, Integrity, Availability, Other | Varies by Context, Read Application Data Uninitialized variables usually contain junk, which can not be trusted for consistency. Depending on the context, uninitialized variables could lead to denial of service conditions, or modify control flow in unexpected ways. They could also contain sensitive information that could be leaked if the variable is used in output. In some cases, an attacker can pre-initialize the variable using previous actions - i.e., control the contents of the variable - which might enable code execution. |
| Availability | Alter Execution Logic, Unexpected State This can cause a race condition if a lock variable check passes when it should not. |
| Authorization, Other | Varies by Context Strings that are not initialized are especially dangerous, since many functions expect a null at the end -- and only at the end -- of a string. |
How to prevent it
Source: MITRE CWE catalog · Official entry on the MITRE website