Base · Medium

CWE-1295: Debug Messages Revealing Unnecessary Information

The product fails to adequately prevent the revealing of unnecessary and potentially sensitive system information within debugging messages.

CWE-1295 · Base Level ·4 CVEs ·1 Mitigations

Description

The product fails to adequately prevent the revealing of unnecessary and potentially sensitive system information within debugging messages.

Debug messages are messages that help troubleshoot an issue by revealing the internal state of the system. For example, debug data in design can be exposed through internal memory array dumps or boot logs through interfaces like UART via TAP commands, scan chain, etc. Thus, the more information contained in a debug message, the easier it is to debug. However, there is also the risk of revealing information that could help an attacker either decipher a vulnerability, and/or gain a better understanding of the system. Thus, this extra information could lower the "security by obscurity" factor. While "security by obscurity" alone is insufficient, it can help as a part of "Defense-in-depth".

Potential Impact

Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation

Read Memory, Bypass Protection Mechanism, Gain Privileges or Assume Identity, Varies by Context

Demonstrative Examples

This example here shows how an attacker can take advantage of unnecessary information in debug messages.
Example 1: Suppose in response to a Test Access Port (TAP) chaining request the debug message also reveals the current TAP hierarchy (the full topology) in addition to the success/failure message.
Example 2: In response to a password-filling request, the debug message, instead of a simple Granted/Denied response, prints an elaborate message, "The user-entered password does not match the actual password stored in <directory name>."
The result of the above examples is that the user is able to gather additional unauthorized information about the system from the debug messages.
The solution is to ensure that Debug messages do not reveal additional details.

Mitigations & Prevention

Implementation

Ensure that a debug message does not reveal any unnecessary information during the debug process for the intended response.

Detection Methods

  • Automated Static Analysis — Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then sea

Real-World CVE Examples

CVE IDDescription
CVE-2022-34364Java-based SDK for TLS has a debug message with unnecessary information
CVE-2021-25476Digital Rights Management (DRM) capability for mobile platform leaks pointer information, simplifying ASLR bypass
CVE-2020-24491Processor generates debug message that contains sensitive information ("addresses of memory transactions").
CVE-2017-18326modem debug messages include cryptographic keys

Frequently Asked Questions

What is CWE-1295?

CWE-1295 (Debug Messages Revealing Unnecessary Information) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The product fails to adequately prevent the revealing of unnecessary and potentially sensitive system information within debugging messages.

How can CWE-1295 be exploited?

Attackers can exploit CWE-1295 (Debug Messages Revealing Unnecessary Information) to read memory, bypass protection mechanism, gain privileges or assume identity, varies by context. This weakness is typically introduced during the Implementation phase of software development.

How do I prevent CWE-1295?

Key mitigations include: Ensure that a debug message does not reveal any unnecessary information during the debug process for the intended response.

What is the severity of CWE-1295?

CWE-1295 is classified as a Base-level weakness (Medium abstraction). It has been observed in 4 real-world CVEs.