이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다. 현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.
Metadata
ID:csharp-security/avoid-debug-mode
Language: C#
Severity: Info
Category: Best Practices
Description
This rule ensures that the method UseDeveloperExceptionPage() is only called when debugging is enabled. The developer exception page provides detailed error information that can expose sensitive data and internal application details if shown in a production environment.
It is important to restrict the use of this page to development or debugging scenarios to prevent leaking potentially sensitive information to end users or attackers. Displaying detailed exception data in production can increase the risk of security vulnerabilities and negatively impact user experience.
To comply with this rule, wrap calls to UseDeveloperExceptionPage() inside conditional statements that check if debugging or development mode is active. For example, use if (enableDebug) { app.UseDeveloperExceptionPage(); } to ensure the exception page is only enabled when appropriate. This practice helps maintain application security and stability across different environments.