Executar análise estática (SAST) na base de código à procura do padrão inseguro no fluxo de dados.
ASP.NET Misconfiguration: Missing Custom Error Page
This vulnerability occurs when an ASP.NET application fails to configure custom error pages, allowing attackers to extract sensitive information from the framework's default error messages.
What is CWE-12?
Real-world CVEs caused by CWE-12
Ainda não há referências CVE públicas associadas a este CWE no catálogo da MITRE.
Trajeto do atacante passo a passo
- 1
The mode attribute of the tag in the Web.config file defines whether custom or default error pages are used.
- 2
In the following insecure ASP.NET application setting, custom error message mode is turned off. An ASP.NET error message with detailed stack trace and platform versions will be returned.
- 3
A more secure setting is to set the custom error message mode for remote users only. No defaultRedirect error page is specified. The local user on the web server will see a detailed stack trace. For remote users, an ASP.NET error message with the server customError configuration setting and the platform version will be returned.
- 4
Another secure option is to set the mode attribute of the tag to use a custom page as follows:
Vulnerable ASP.NET
In the following insecure ASP.NET application setting, custom error message mode is turned off. An ASP.NET error message with detailed stack trace and platform versions will be returned.
<customErrors mode="Off" /> Secure ASP.NET
A more secure setting is to set the custom error message mode for remote users only. No defaultRedirect error page is specified. The local user on the web server will see a detailed stack trace. For remote users, an ASP.NET error message with the server customError configuration setting and the platform version will be returned.
<customErrors mode="RemoteOnly" /> How to prevent CWE-12
- System Configuration Handle exceptions appropriately in source code. ASP .NET applications should be configured to use custom error pages instead of the framework default page.
- Architecture and Design Do not attempt to process an error or attempt to mask it.
- Implementation Verify return values are correct and do not supply sensitive information about the system.
How to detect CWE-12
Executar testes dinâmicos de segurança de aplicações (DAST) contra o endpoint em execução.
Monitorizar os registos em tempo de execução para traços de exceção invulgares, input malformado ou tentativas de contornar a autorização.
Revisão de código: sinalizar qualquer novo código que trate input desta superfície sem usar os ajudantes validados do framework.
O Plexicus deteta automaticamente o CWE-12 e abre um PR de correção em menos de 60 segundos.
O Codex Remedium analisa cada commit, identifica esta fraqueza exata e entrega um pull request pronto para revisão com o patch. Sem tickets. Sem transferências.
Frequently asked questions
O que é o CWE-12?
This vulnerability occurs when an ASP.NET application fails to configure custom error pages, allowing attackers to extract sensitive information from the framework's default error messages.
Qual a gravidade do CWE-12?
A MITRE não publicou uma classificação de probabilidade de exploração para esta fraqueza. Trate-a como impacto médio até o seu modelo de ameaças provar o contrário.
Que linguagens ou plataformas são afetadas pelo CWE-12?
MITRE lists the following affected platforms: ASP.NET.
Como posso prevenir o CWE-12?
Handle exceptions appropriately in source code. ASP .NET applications should be configured to use custom error pages instead of the framework default page. Do not attempt to process an error or attempt to mask it.
Como é que o Plexicus deteta e corrige o CWE-12?
O motor SAST do Plexicus correlaciona a assinatura de fluxo de dados do CWE-12 em cada commit. Quando é encontrada uma correspondência, o nosso agente Codex Remedium abre um PR de correção com o código corrigido, testes e um resumo de uma linha para o revisor.
Onde posso saber mais sobre o CWE-12?
A MITRE publica a definição canónica em https://cwe.mitre.org/data/definitions/12.html. Pode também consultar a documentação da OWASP e do NIST para orientações adjacentes.
Weaknesses related to CWE-12
Missing Custom Error Page
This vulnerability occurs when an application fails to display its own user-friendly error pages, instead falling back to default system…
J2EE Misconfiguration: Missing Custom Error Page
This vulnerability occurs when a J2EE application uses the server's default error pages instead of custom ones, potentially leaking…
Further reading
- MITRE — CWE-12 oficial https://cwe.mitre.org/data/definitions/12.html
- Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors https://samate.nist.gov/SSATTM_Content/papers/Seven%20Pernicious%20Kingdoms%20-%20Taxonomy%20of%20Sw%20Security%20Errors%20-%20Tsipenyuk%20-%20Chess%20-%20McGraw.pdf
- ASP.NET Misconfiguration: Missing Custom Error Handling https://www.owasp.org/index.php/ASP.NET_Misconfiguration:_Missing_Custom_Error_Handling
Pare de pagar por desenvolvedor.
Comece a fechar o ciclo.
O Plexicus é o ASPM nativo de IA que verifica, filtra, corrige, pentesta e explica — de forma autónoma. Programadores ilimitados, repos ilimitados, ações de IA de utilização justa. Nível gratuito real, €269/mo anual quando estiver pronto.