CWE-489

Active Debug Code

Weakness Description

The product is released with debugging code still enabled or active.

Potential Mitigations

Build and CompilationDistribution

Remove debug code before deploying the application.

Common Consequences

ConfidentialityIntegrityAvailabilityAccess ControlOther
Bypass Protection MechanismRead Application DataGain Privileges or Assume IdentityVaries by Context

Active debug code can create unintended entry points or expose sensitive information. The severity of the exposed debug code will depend on the particular instance. At the least, it will give an attacker sensitive information about the settings and mechanics of web applications on the server. At worst, as is often the case, the debug code will allow an attacker complete control over the web application and server, as well as confidential information that either of these access.

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 searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

Advertisement

Related Weaknesses