CWE-1419: Incorrect Initialization of Resource
Description
The product attempts to initialize a resource but does not correctly do so, which might leave the resource in an unexpected, incorrect, or insecure state when it is accessed.
This can have security implications when the associated resource is expected to have certain properties or values. Examples include a variable that determines whether a user has been authenticated or not, or a register or fuse value that determines the security state of the product. For software, this weakness can frequently occur when implicit initialization is used, meaning the resource is not explicitly set to a specific value. For example, in C, memory is not necessarily cleared when it is allocated on the stack, and many scripting languages use a default empty, null value, or zero value when a variable is not explicitly initialized. For hardware, this weakness frequently appears with reset values and fuses. After a product reset, hardware may initialize registers incorrectly. During different phases of a product lifecycle, fuses may be set to incorrect values. Even if fuses are set to correct values, the lines to the fuse could be broken or there might be hardware on the fuse line that alters the fuse value to be incorrect.
- Abstraction
- ClassAn abstract weakness, independent of any specific language or technology.
- Likelihood of exploit
- Not rated by MITRE
- Status
- Incomplete
Common consequences
- Confidentiality
Read Memory; Read Application Data; Unexpected State
- AuthorizationIntegrity
Gain Privileges or Assume Identity
- Other
Varies by Context
The technical impact can vary widely based on how the resource is used in the product, and whether its contents affect security decisions.
Potential mitigations
- Implementation
Choose the safest-possible initialization for security-related resources.
- Implementation
Ensure that each resource (whether variable, memory buffer, register, etc.) is fully initialized.
- Implementation
Pay close attention to complex conditionals or reset sources that affect initialization, since some paths might not perform the initialization.
- Architecture and Design
Ensure that the design and architecture clearly identify what the initialization should be, and that the initialization does not have security implications.
Related weaknesses
Parent weaknesses
Child weaknesses
- CWE-454External Initialization of Trusted Variables or Data Stores
- CWE-1051Initialization with Hard-Coded Network Resource Configuration Data
- CWE-1052Excessive Use of Hard-Coded Literals in Initialization
- CWE-1188Initialization of a Resource with an Insecure Default
- CWE-1221Incorrect Register Defaults or Module Parameters
CAPEC attack patterns that exploit it
CWE 4.20 links no CAPEC attack pattern to this weakness.