Description
The hardware does not fully clear security-sensitive values, such as keys and intermediate values in cryptographic operations, when debug mode is entered.
Security sensitive values, keys, intermediate steps of cryptographic operations, etc. are stored in temporary registers in the hardware. If these values are not cleared when debug mode is entered they may be accessed by a debugger allowing sensitive information to be accessible by untrusted parties.
Potential Impact
Confidentiality
Read Memory
Access Control
Bypass Protection Mechanism
Demonstrative Examples
In the above scenario, registers that store keys and intermediate values of cryptographic operations are not cleared when system enters debug mode. An untrusted actor running a debugger may read the contents of these registers and gain access to secret keys and other sensitive cryptographic information.Whenever the chip enters debug mode, all registers containing security-sensitive data are be cleared rendering them unreadable.module aes1_wrapper #(
...
assign core_key0 = debug_mode_i ? 'b0 : {
key_reg0[7],
key_reg0[6],
key_reg0[5],
key_reg0[4],
key_reg0[3],
key_reg0[2],
key_reg0[1],
key_reg0[0]};
assign core_key1 = {
key_reg1[7],
key_reg1[6],
key_reg1[5],
key_reg1[4],
key_reg1[3],
key_reg1[2],
key_reg1[1],
key_reg1[0]};
...
endmodulemodule aes1_wrapper #(
...
assign core_key0 = debug_mode_i ? 'b0 : {
key_reg0[7],
key_reg0[6],
key_reg0[5],
key_reg0[4],
key_reg0[3],
key_reg0[2],
key_reg0[1],
key_reg0[0]};
assign core_key1 = debug_mode_i ? 'b0 : {
key_reg1[7],
key_reg1[6],
key_reg1[5],
key_reg1[4],
key_reg1[3],
key_reg1[2],
key_reg1[1],
key_reg1[0]};
...
endmoduleMitigations & Prevention
Whenever debug mode is enabled, all registers containing sensitive assets must be cleared.
Real-World CVE Examples
| CVE ID | Description |
|---|---|
| CVE-2021-33080 | Uncleared debug information in memory accelerator for SSD product exposes sensitive system information |
| CVE-2022-31162 | Rust library leaks Oauth client details in application debug logs |
Related Weaknesses
Frequently Asked Questions
What is CWE-1258?
CWE-1258 (Exposure of Sensitive System Information Due to Uncleared Debug Information) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The hardware does not fully clear security-sensitive values, such as keys and intermediate values in cryptographic operations, when debug mode is entered.
How can CWE-1258 be exploited?
Attackers can exploit CWE-1258 (Exposure of Sensitive System Information Due to Uncleared Debug Information) to read memory. This weakness is typically introduced during the Architecture and Design, Implementation phase of software development.
How do I prevent CWE-1258?
Key mitigations include: Whenever debug mode is enabled, all registers containing sensitive assets must be cleared.
What is the severity of CWE-1258?
CWE-1258 is classified as a Base-level weakness (Medium abstraction). It has been observed in 2 real-world CVEs.