# Active Debug Code (CWE-489) The product is deployed to unauthorized actors with debugging code still enabled or active, which can create unintended entry points or information leaks. **Stack:** JavaScript - Prevalence: उच्च बार-बार शोषित - Impact: क्रिटिकल 1 क्रिटिकल गंभीरता वाले नियम - Prevention: प्रलेखित 6 फिक्स उदाहरण **OWASP:** Security Misconfiguration (A05:2021-Security Misconfiguration) - #5 ## Description Debug code is often written to allow easier testing and debugging. This code is not intended to be shipped to production but is sometimes inadvertently left in the product. Debug code often exposes information about the product's internal structure or creates additional attack surface. ## Prevention 1 Shoulder डिटेक्शन नियमों पर आधारित Active Debug Code के लिए रोकथाम रणनीतियाँ। ### JavaScript Use environment variables for debug configuration instead of hardcoded flags ## Warning Signs - [MEDIUM] Debug flag at line ... is hardcoded to true - [MEDIUM] hardcoded debug flags that expose sensitive information or enable debugging features in production ## Consequences - एप्लिकेशन डेटा पढ़ना - सुरक्षा तंत्र को बायपास करना - अनधिकृत कोड निष्पादित करना ## Mitigations - उत्पाद को प्रोडक्शन में डिप्लॉय करने से पहले डिबगिंग कोड हटाएँ - ऐसी build कॉन्फ़िगरेशनों का उपयोग करें जो प्रोडक्शन builds से डिबग कोड स्वतः बाहर रखें - रिलीज़ से पहले डिबग endpoints और backdoors के लिए कोड का ऑडिट करें ## Detection - Total rules: 6 - Critical: 1 - Languages: python, go, javascript, typescript ## Rules by Language ### Javascript (1 rules) - **Debug Mode Enabled in Production** [MEDIUM]: Detects hardcoded debug flags that expose sensitive information or enable debugging features in production. - Remediation: Use environment variables for debug/development mode configuration. ### Typescript (1 rules) - **Debug Mode Enabled in Production** [MEDIUM]: Detects hardcoded debug flags that expose sensitive information or enable debugging features in production. - Remediation: Use environment variables for debug/development mode configuration.