2281
Language : Not Language-Specific (Prevalence = Undetermined)
Operating_System : Not OS-Specific (Prevalence = Undetermined)
Architecture : Not Architecture-Specific (Prevalence = Undetermined)
Technology : Not Technology-Specific (Prevalence = Undetermined)
Common Consequences
Scope Impact Likelihood
Confidentiality Read Memory
Read Application Data
Unexpected State
Unknown
Authorization
Integrity
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
Phase: Implementation
Choose the safest-possible initialization for security-related resources.
Phase: Implementation
Ensure that each resource (whether variable, memory buffer, register, etc.) is fully initialized.
Phase: Implementation
Pay close attention to complex conditionals or reset sources that affect initialization, since some
paths might not perform the initialization.
Phase: 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.
Demonstrative Examples
Example 1:
Consider example design module system verilog code shown below. The register_example module
is an example parameterized module that defines two parameters, REGISTER_WIDTH and
REGISTER_DEFAULT. Register_example module defines a Secure_mode setting, which when set
makes the register content read-only and not modifiable by software writes. register_top module
instantiates two registers, Insecure_Device_ID_1 and Insecure_Device_ID_2. Generally, registers
containing device identifier values are required to be read only to prevent any possibility of software
modifying these values.
Example Language: Verilog (Bad)
// Parameterized Register module example
// Secure_mode : REGISTER_DEFAULT[0] : When set to 1 register is read only and not writable//
module register_example
#(
parameter REGISTER_WIDTH = 8, // Parameter defines width of register, default 8 bits
parameter [REGISTER_WIDTH-1:0] REGISTER_DEFAULT = 2**REGISTER_WIDTH -2 // Default value of register
computed from Width. Sets all bits to 1s except bit 0 (Secure _mode)
)
(
input [REGISTER_WIDTH-1:0] Data_in,
input Clk,
input resetn,
CWE Version 4.14
CWE-1419: Incorrect Initialization of Resource
CWE-1419: Incorrect Initialization of Resource