CWE-1244: Internal Asset Exposed to Unsafe Debug Access Level or State
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.
How it's found
Internal Asset Exposed to Unsafe Debug Access Level or State is typically found by tracing untrusted input from where it enters the system to the point where it is used without the check or neutralization this weakness describes, combining manual code review with dynamic testing.
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.
Vulnerable vs. safe
debug_mode_d = dcsr_q.ebreakm;riscv::PRIV_LVL_M: begin// check that we actually want to enter debug depending on the privilege level we are currently inunique case (priv_lvl_o)
debug_mode_d = dcsr_q.ebreaku;riscv::PRIV_LVL_U: begin
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 #(...............debug_mode_d = dcsr_q.ebreakm;riscv::PRIV_LVL_M: begin// check that we actually want to enter debug depending on the privilege level we are currently inunique case (priv_lvl_o)
debug_mode_d = dcsr_q.ebreaku;riscv::PRIV_LVL_U: begin
(debug_mode_q && umode_i) ? riscv::PRIV_LVL_M : priv_lvl_q;
assign priv_lvl_o =
debug_mode_q <= debug_mode_d;module csr_regfile #(...............Consequences
- Read Memory: If a protection mechanism does not ensure that internal assets have the correct debug access level during each boot stage or change in system state, an attacker could obtain sensitive information from the internal asset using a debugger.
- Modify Memory
- Gain Privileges or Assume Identity, Bypass Protection Mechanism
Mitigations
- Architecture and Design/Implementation: For security-sensitive assets accessible over debug/test interfaces, only allow trusted agents.
- Architecture and Design: Apply blinding [REF-1219] or masking techniques in strategic areas.
- Implementation: Add shielding or tamper-resistant protections to the device, which increases the difficulty and cost for accessing debug/test interfaces.
Where this fits in a TurboPentest engagement
This weakness is not covered by the automated black-box pentest. IntegSec pentesters cover it in a manual engagement.
Frequently asked questions
What is CWE-1244?
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.
How do you find Internal Asset Exposed to Unsafe Debug Access Level or State?
Internal Asset Exposed to Unsafe Debug Access Level or State is typically found by tracing untrusted input from where it enters the system to the point where it is used without the check or neutralization this weakness describes, combining manual code review with dynamic testing.
What is the impact of CWE-1244?
Read Memory: If a protection mechanism does not ensure that internal assets have the correct debug access level during each boot stage or change in system state, an attacker could obtain sensitive information from the internal asset using a debugger. Modify Memory Gain Privileges or Assume Identity, Bypass Protection Mechanism
Does TurboPentest test for Internal Asset Exposed to Unsafe Debug Access Level or State?
This weakness is not covered by the automated black-box pentest. IntegSec pentesters cover it in a manual engagement.
Related CWEs
Written and reviewed by
Michel Chamberland - Founder & CEO, IntegSec
CISSP, OSCP, OSCE, CEH, GIAC, CCSK · 20+ years in offensive security
Michel has spent 20+ years on offensive security teams including IBM X-Force Red and Trustwave SpiderLabs, leading penetration tests, red team engagements, and breach response for Fortune 500 customers. He is the founder of IntegSec and the architect of TurboPentest.
Find these issues before an attacker does
TurboPentest runs an agentic AI pentest against your target and reports findings with proof, from $99 per target.
Start a pentest