Debug Features Enabled
ID |
csharp.debug_features_enabled |
Severity |
high |
Resource |
Misconfiguration |
Language |
CSharp |
Tags |
CWE:11, NIST.SP.800-53, OWASP:2021:A7, PCI-DSS:6.5.3 |
Description
Debug mode being enabled in an ASP.NET application can expose sensitive information, potentially leading to security vulnerabilities.
Rationale
Enabling debug mode in an ASP.NET application is intended for use during the development phase and not in production.
When an ASP.NET application runs with debugging enabled, it may print detailed application error messages, stack traces, and other sensitive information, exposing this to a potential attacker.
For instance, this is typically done by setting the debug
attribute to true
within the web.config
file:
<compilation debug="true" targetFramework="4.7.2" />
In production, this can lead to the application executing slower due to the extra overhead for debugging and possibly exposing sensitive technical details.
Remediation
To remediate this vulnerability, ensure that the debug
attribute in the web.config
file is set to false
when deploying your ASP.NET application to production environments. This elimination of debug information reduces the risk of exposing sensitive internal information to an attacker.
<compilation debug="false" targetFramework="4.7.2" />
Additionally, review all environment configurations and deployment scripts to ensure debug
mode is only ever enabled in a development environment.
References
-
CWE-11 : ASP.NET Misconfiguration: Creating Debug Binary.