Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-489:Active Debug Code
Weakness ID:489
Version:v4.17
Weakness Name:Active Debug Code
Vulnerability Mapping:Allowed
Abstraction:Base
Structure:Simple
Status:Draft
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

The product is deployed to unauthorized actors with debugging code still enabled or active, which can create unintended entry points or expose sensitive information.

▼Extended Description

A common development practice is to add "back door" code specifically designed for debugging or testing purposes that is not intended to be shipped or deployed with the product. These back door entry points create security risks because they are not considered during design or testing and fall outside of the expected operating conditions of the product.

▼Alternate Terms
Leftover debug code

This term originates from Seven Pernicious Kingdoms

▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
CanPrecedeAllowedB215Insertion of Sensitive Information Into Debugging Code
ChildOfDiscouragedP710Improper Adherence to Coding Standards
ParentOfAllowedV11ASP.NET Misconfiguration: Creating Debug Binary
Nature: CanPrecede
Mapping: Allowed
Type: Base
ID: 215
Name: Insertion of Sensitive Information Into Debugging Code
Nature: ChildOf
Mapping: Discouraged
Type: Pillar
ID: 710
Name: Improper Adherence to Coding Standards
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 11
Name: ASP.NET Misconfiguration: Creating Debug Binary
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedC4857PK - Encapsulation
MemberOfProhibitedC731OWASP Top Ten 2004 Category A10 - Insecure Configuration Management
MemberOfProhibitedC1002SFP Secondary Cluster: Unexpected Entry Points
MemberOfProhibitedC1006Bad Coding Practices
MemberOfProhibitedC1371ICS Supply Chain: Poorly Documented or Undocumented Features
MemberOfProhibitedC1412Comprehensive Categorization: Poor Coding Practices
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 485
Name: 7PK - Encapsulation
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 731
Name: OWASP Top Ten 2004 Category A10 - Insecure Configuration Management
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1002
Name: SFP Secondary Cluster: Unexpected Entry Points
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1006
Name: Bad Coding Practices
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1371
Name: ICS Supply Chain: Poorly Documented or Undocumented Features
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1412
Name: Comprehensive Categorization: Poor Coding Practices
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-294Not Language-Specific Weaknesses
MemberOfProhibitedBSBOSS-305ICS/OT (technology class) Weaknesses
MemberOfProhibitedBSBOSS-307Not Technology-Specific (technology class) Weaknesses
MemberOfProhibitedBSBOSS-316Bypass Protection Mechanism (impact)
MemberOfProhibitedBSBOSS-326Varies by Context (impact)
MemberOfProhibitedBSBOSS-328Read Application Data (impact)
MemberOfProhibitedBSBOSS-332Gain Privileges or Assume Identity (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-294
Name: Not Language-Specific Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-305
Name: ICS/OT (technology class) Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-307
Name: Not Technology-Specific (technology class) Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-316
Name: Bypass Protection Mechanism (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-326
Name: Varies by Context (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-328
Name: Read Application Data (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-332
Name: Gain Privileges or Assume Identity (impact)
▼Relevant To View
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC1002SFP Secondary Cluster: Unexpected Entry Points
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1002
Name: SFP Secondary Cluster: Unexpected Entry Points
Relevant to the view"Software Development - (699)"
NatureMappingTypeIDName
MemberOfProhibitedC1006Bad Coding Practices
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1006
Name: Bad Coding Practices
Relevant to the view"SEI ETF Categories of Security Vulnerabilities in ICS - (1358)"
NatureMappingTypeIDName
MemberOfProhibitedC1371ICS Supply Chain: Poorly Documented or Undocumented Features
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1371
Name: ICS Supply Chain: Poorly Documented or Undocumented Features
Relevant to the view"Seven Pernicious Kingdoms - (700)"
NatureMappingTypeIDName
MemberOfProhibitedC4857PK - Encapsulation
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 485
Name: 7PK - Encapsulation
▼Background Detail

▼Common Consequences
ScopeLikelihoodImpactNote
ConfidentialityIntegrityAvailabilityAccess ControlOtherN/ABypass Protection MechanismRead Application DataGain Privileges or Assume IdentityVaries by Context

The severity of the exposed debug application 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 application will allow an attacker complete control over the web application and server, as well as confidential information that either of these access.

Scope: Confidentiality, Integrity, Availability, Access Control, Other
Likelihood: N/A
Impact: Bypass Protection Mechanism, Read Application Data, Gain Privileges or Assume Identity, Varies by Context
Note:

The severity of the exposed debug application 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 application will allow an attacker complete control over the web application and server, as well as confidential information that either of these access.

▼Potential Mitigations
Phase:Build and Compilation, Distribution
Mitigation ID:
Strategy:
Effectiveness:
Description:

Remove debug code before deploying the application.

Note:

▼Modes Of Introduction
Phase: Implementation
Note:

In web-based applications, debug code is used to test and modify web application properties, configuration information, and functions. If a debug application is left on a production server, this oversight during the "software process" allows attackers access to debug functionality.

Phase: Build and Compilation
Note:

N/A

Phase: Operation
Note:

N/A

▼Applicable Platforms
Languages
Class: Not Language-Specific(Undetermined Prevalence)
Technology
Class: Not Technology-Specific(Undetermined Prevalence)
Class: ICS/OT(Undetermined Prevalence)
▼Demonstrative Examples
Example 1

Debug code can be used to bypass authentication. For example, suppose an application has a login script that receives a username and a password. Assume also that a third, optional, parameter, called "debug", is interpreted by the script as requesting a switch to debug mode, and that when this parameter is given the username and password are not checked. In such a case, it is very simple to bypass the authentication process if the special behavior of the application regarding the debug parameter is known. In a case where the form is:

Language: ( code)
N/A

Language: HTML(Bad code)
<FORM ACTION="/authenticate_login.cgi"> <INPUT TYPE=TEXT name=username> <INPUT TYPE=PASSWORD name=password> <INPUT TYPE=SUBMIT> </FORM>

Language: ( code)
N/A

Then a conforming link will look like:

Language: (Informative code)
http://TARGET/authenticate_login.cgi?username=...&password=...

Language: ( code)
N/A

An attacker can change this to:

Language: (Attack code)
http://TARGET/authenticate_login.cgi?username=&password=&debug=1

Language: ( code)
N/A

Which will grant the attacker access to the site, bypassing the authentication process.

▼Observed Examples
ReferenceDescription
▼Affected Resources
    ▼Functional Areas
      ▼Weakness Ordinalities
      OrdinalityDescription
      Indirect
      N/A
      Primary
      N/A
      Ordinality: Indirect
      Description:
      N/A
      Ordinality: Primary
      Description:
      N/A
      ▼Detection Methods
      Automated Static Analysis
      Detection Method ID:DM-14
      Description:

      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
      Note:

      N/A

      ▼Vulnerability Mapping Notes
      Usage:Allowed
      Reason:Acceptable-Use
      Rationale:

      This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.

      Comments:

      Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

      Suggestions:
      ▼Notes
      Other

      In J2EE a main method may be a good indicator that debug code has been left in the application, although there may not be any direct security impact.

      N/A

      ▼Taxonomy Mappings
      Taxonomy NameEntry IDFitEntry Name
      7 Pernicious KingdomsN/AN/ALeftover Debug Code
      OWASP Top Ten 2004A10CWE More SpecificInsecure Configuration Management
      Software Fault PatternsSFP28N/AUnexpected access points
      Taxonomy Name: 7 Pernicious Kingdoms
      Entry ID: N/A
      Fit: N/A
      Entry Name: Leftover Debug Code
      Taxonomy Name: OWASP Top Ten 2004
      Entry ID: A10
      Fit: CWE More Specific
      Entry Name: Insecure Configuration Management
      Taxonomy Name: Software Fault Patterns
      Entry ID: SFP28
      Fit: N/A
      Entry Name: Unexpected access points
      ▼Related Attack Patterns
      IDName
      CAPEC-121
      Exploit Non-Production Interfaces
      CAPEC-661
      Root/Jailbreak Detection Evasion via Debugging
      ID: CAPEC-121
      Name: Exploit Non-Production Interfaces
      ID: CAPEC-661
      Name: Root/Jailbreak Detection Evasion via Debugging
      ▼References
      Reference ID: REF-6
      Title: Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors
      Author: Katrina Tsipenyuk, Brian Chess, Gary McGraw
      Section:
      Publication:
      NIST Workshop on Software Security Assurance Tools Techniques and Metrics
      Publisher:NIST
      Edition:
      URL:https://samate.nist.gov/SSATTM_Content/papers/Seven%20Pernicious%20Kingdoms%20-%20Taxonomy%20of%20Sw%20Security%20Errors%20-%20Tsipenyuk%20-%20Chess%20-%20McGraw.pdf
      URL Date:
      Day:07
      Month:11
      Year:2005
      Details not found