---
title: "CWE-12: ASP.NET Misconfiguration: Missing Custom Error Page"
url: https://radicalnotion.ai/cwe/cwe-12
type: cwe
description: "An ASP .NET application must enable custom error pages in order to prevent attackers from mining information from the framework's built-in responses."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-12: ASP.NET Misconfiguration: Missing Custom Error Page

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 1
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

An ASP .NET application must enable custom error pages in order to prevent attackers from mining information from the framework's built-in responses.

## Background

The mode attribute of the \<customErrors\> tag defines whether custom or default error pages are used.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |
| Operation | - |

## Applicable platforms

**Languages:** ASP.NET (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality | Read Application Data | Default error pages gives detailed information about the error that occurred, and should not be used in production environments. Attackers can leverage the additional information provided by a default error page to mount attacks targeted on the framework, database, or other resources used by the application. |

## Potential mitigations

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

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

## Demonstrative examples

### Example 1

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

Bad code:

```aspnet
<customErrors mode="Off" />
```

Good code:

```aspnet
<customErrors mode="RemoteOnly" />
```

Good code:

```aspnet
<customErrors mode="On" defaultRedirect="YourErrorPage.htm" />
```

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2020-6994 | Improper Input Validation in Hitachi Energy AFS660/AFS665 | critical | 9.8 | - | No | 2020-04-03 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-756](https://radicalnotion.ai/cwe/cwe-756) | Missing Custom Error Page |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| 7 Pernicious Kingdoms | ASP.NET Misconfiguration: Missing Custom Error Handling | - | - |

## Frequently asked questions

### What is CWE-12?

An ASP.NET application must enable custom error pages in order to prevent attackers from mining information from the framework's built-in responses.

### What CVEs are caused by CWE-12?

1 recorded CVE is attributed to CWE-12: CVE-2020-6994.

### How do you prevent 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.

### How is CWE-12 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-12?

Exploiting CWE-12 can lead to: Read Application Data.

### Is CWE-12 actively exploited?

1 recorded CVE is caused by CWE-12; it is not currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/12.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-12). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
