CWE-12 Variant Draft

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.

Definition

What is 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.
When an ASP.NET application encounters an error, it can reveal detailed technical information in its default response, such as stack traces, server file paths, database connection details, or snippets of source code. Attackers actively probe for these errors to gather intelligence about your application's internal structure, which they can then use to plan more targeted and damaging attacks. To prevent this, you must configure custom error pages in your web.config file. This ensures that any runtime errors display a generic, user-friendly message to visitors while logging the full technical details securely on the server. This simple configuration step acts as a critical layer of defense, stopping information leaks that could compromise your entire application.
Auswirkungen in der Praxis

Real-world CVEs caused by CWE-12

Bisher sind in MITREs Katalog keine öffentlichen CVE-Referenzen mit dieser CWE verknüpft.

Wie Angreifer es ausnutzen

Angreiferpfad Schritt für Schritt

  1. 1

    The mode attribute of the tag in the Web.config file defines whether custom or default error pages are used.

  2. 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. 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. 4

    Another secure option is to set the mode attribute of the tag to use a custom page as follows:

Verwundbares Codebeispiel

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.

Verwundbar ASP.NET
<customErrors mode="Off" />
Sicheres Codebeispiel

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.

Sicher ASP.NET
<customErrors mode="RemoteOnly" />
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Präventions-Checkliste

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.
Erkennungssignale

How to detect CWE-12

SAST High

Führe statische Analyse (SAST) auf der Codebasis aus und suche im Datenfluss nach dem unsicheren Muster.

DAST Moderate

Führe dynamische Application-Security-Tests gegen den Live-Endpoint aus.

Runtime Moderate

Beobachte Runtime-Logs auf ungewöhnliche Exception-Traces, fehlerhafte Eingaben oder Versuche, Autorisierung zu umgehen.

Code review Moderate

Code Review: Markiere jeden neuen Code, der Eingaben von dieser Oberfläche ohne validierte Framework-Helper verarbeitet.

Plexicus Auto-Fix

Plexicus erkennt CWE-12 automatisch und öffnet in unter 60 Sekunden einen Fix-PR.

Codex Remedium scannt jeden Commit, identifiziert genau diese Schwachstelle und liefert einen reviewer-ready Pull Request mit dem Patch. Keine Tickets. Keine Hand-offs.

Häufig gestellte Fragen

Frequently asked questions

Was ist 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.

Wie gravierend ist CWE-12?

MITRE hat für diese Schwachstelle keine Exploit-Wahrscheinlichkeit veröffentlicht. Behandle sie als mittlere Auswirkung, bis dein Threat Model anderes belegt.

Welche Sprachen oder Plattformen sind von CWE-12 betroffen?

MITRE lists the following affected platforms: ASP.NET.

Wie kann ich CWE-12 verhindern?

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.

Wie erkennt und behebt Plexicus CWE-12?

Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-12 bei jedem Commit. Bei einem Treffer öffnet unser Codex-Remedium-Agent einen Fix-PR mit korrigiertem Code, Tests und einer einzeiligen Zusammenfassung für den Reviewer.

Wo erfahre ich mehr über CWE-12?

MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/12.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.

Bereit, wenn du es bist

Schluss mit dem Bezahlen pro Entwickler.
Schließ den Kreislauf.

Plexicus ist die KI-native ASPM, die scannt, filtert, fixt, pentestet und erklärt — autonom. Unbegrenzte Entwickler, unbegrenzte Repos, Fair-Use-KI-Aktionen. Echter kostenloser Tarif, €269/mo jährlich, wenn du bereit bist.