Description
The product uses physical debug or test interfaces with support for multiple access levels, but it assigns the wrong debug access level to an internal asset, providing unintended access to the asset from untrusted debug agents.
Debug authorization can have multiple levels of access, defined such that different system internal assets are accessible based on the current authorized debug level. Other than debugger authentication (e.g., using passwords or challenges), the authorization can also be based on the system state or boot stage. For example, full system debug access might only be allowed early in boot after a system reset to ensure that previous session data is not accessible to the authenticated debugger.
Potential Impact
Confidentiality
Read Memory
Integrity
Modify Memory
Authorization, Access Control
Gain Privileges or Assume Identity, Bypass Protection Mechanism
Demonstrative Examples
1 bit
0x0 = JTAG debugger is enabled (default)
JTAG_SHIELD
0x1 = JTAG debugger is disabledThe default value of this register bit should be set to 1 to prevent the JTAG from being enabled at system reset.module csr_regfile #(
...
// check that we actually want to enter debug depending on the privilege level we are currently in
unique case (priv_lvl_o)
riscv::PRIV_LVL_M: begin
debug_mode_d = dcsr_q.ebreakm;
...
riscv::PRIV_LVL_U: begin
debug_mode_d = dcsr_q.ebreaku;
...
assign priv_lvl_o = (debug_mode_q || umode_i) ? riscv::PRIV_LVL_M : priv_lvl_q;
...
debug_mode_q <= debug_mode_d;
...module csr_regfile #(
...
// check that we actually want to enter debug depending on the privilege level we are currently in
unique case (priv_lvl_o)
riscv::PRIV_LVL_M: begin
debug_mode_d = dcsr_q.ebreakm;
...
riscv::PRIV_LVL_U: begin
debug_mode_d = dcsr_q.ebreaku;
...
assign priv_lvl_o = (debug_mode_q && umode_i) ? riscv::PRIV_LVL_M : priv_lvl_q;
...
debug_mode_q <= debug_mode_d;
...Mitigations & Prevention
For security-sensitive assets accessible over debug/test interfaces, only allow trusted agents.
Apply blinding [REF-1219] or masking techniques in strategic areas.
Add shielding or tamper-resistant protections to the device, which increases the difficulty and cost for accessing debug/test interfaces.
Detection Methods
- Manual Analysis Moderate — Check 2 devices for their passcode to authenticate access to JTAG/debugging ports. If the passcodes are missing or the same, update the design to fix and retest. Check communications over JTAG/debugging ports for encryption. If the communications are not encrypted, fix the design and retest.
Real-World CVE Examples
| CVE ID | Description |
|---|---|
| CVE-2019-18827 | After ROM code execution, JTAG access is disabled. But before the ROM code is executed, JTAG access is possible, allowing a user full system access. This allows a user to modify the boot flow and suc |
Related Weaknesses
Frequently Asked Questions
What is CWE-1244?
CWE-1244 (Internal Asset Exposed to Unsafe Debug Access Level or State) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The product uses physical debug or test interfaces with support for multiple access levels, but it assigns the wrong debug access level to an internal asset, providing unintend...
How can CWE-1244 be exploited?
Attackers can exploit CWE-1244 (Internal Asset Exposed to Unsafe Debug Access Level or State) to read memory. This weakness is typically introduced during the Architecture and Design, Implementation phase of software development.
How do I prevent CWE-1244?
Key mitigations include: For security-sensitive assets accessible over debug/test interfaces, only allow trusted agents.
What is the severity of CWE-1244?
CWE-1244 is classified as a Base-level weakness (Medium abstraction). It has been observed in 1 real-world CVEs.