CWE-756 Base Incompleto

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 messages that can leak sensitive technical details.

Definición

What is CWE-756?

This vulnerability occurs when an application fails to display its own user-friendly error pages, instead falling back to default system messages that can leak sensitive technical details.
When an application crashes or encounters an unexpected condition, the web server or framework often generates a default error response. These generic pages can be a goldmine for attackers, revealing stack traces, database schemas, server versions, internal file paths, or snippets of code. This exposed information significantly lowers the effort required for further exploitation, as it provides clear clues about the underlying technology and potential weaknesses. To prevent this, developers should implement a centralized error handler that intercepts all uncaught exceptions and HTTP error statuses (like 404 or 500). This handler must then respond with a consistent, branded page that informs the user a problem occurred—without any technical details—while logging the full diagnostic information securely on the server side for internal debugging. This simple practice improves both security and user experience.
Impacto en el mundo real

Real-world CVEs caused by CWE-756

Todavía no hay CVEs públicos enlazados a esta CWE en el catálogo de MITRE.

Cómo lo explotan los atacantes

Ruta del atacante paso a paso

  1. 1

    In the snippet below, an unchecked runtime exception thrown from within the try block may cause the container to display its default error page (which may contain a full stack trace, among other things).

  2. 2

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

  3. 3

    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.

  4. 4

    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.

  5. 5

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

Ejemplo de código vulnerable

Vulnerable Java

In the snippet below, an unchecked runtime exception thrown from within the try block may cause the container to display its default error page (which may contain a full stack trace, among other things).

Vulnerable Java
Public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  	try {
  		...
  	} catch (ApplicationSpecificException ase) {
  		logger.error("Caught: " + ase.toString());
  	}
  }
Ejemplo de código seguro

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.

Seguro 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.
Lista de prevención

How to prevent CWE-756

  • Architecture Use safe-by-default frameworks and APIs that prevent the unsafe pattern from being expressible.
  • Implementation Validate input at trust boundaries; use allowlists, not denylists.
  • Implementation Apply the principle of least privilege to credentials, file paths, and runtime permissions.
  • Testing Cover this weakness in CI: SAST rules + targeted unit tests for the data flow.
  • Operation Monitor logs for the runtime signals listed in the next section.
Señales de detección

How to detect CWE-756

SAST High

Ejecuta análisis estático (SAST) sobre el código buscando el patrón inseguro en el flujo de datos.

DAST Moderate

Ejecuta pruebas dinámicas de seguridad de aplicaciones (DAST) contra el endpoint en vivo.

Runtime Moderate

Vigila los logs en tiempo de ejecución para detectar trazas de excepción inusuales, entradas malformadas o intentos de bypass de autorización.

Code review Moderate

Revisión de código: marca cualquier código nuevo que maneje entrada desde esta superficie sin usar los helpers validados del framework.

Auto-corrección de Plexicus

Plexicus detecta automáticamente CWE-756 y abre un PR de corrección en menos de 60 segundos.

Codex Remedium escanea cada commit, identifica esta debilidad concreta y entrega un pull request listo para revisión con el parche. Sin tickets. Sin traspasos.

Preguntas frecuentes

Frequently asked questions

¿Qué es CWE-756?

This vulnerability occurs when an application fails to display its own user-friendly error pages, instead falling back to default system messages that can leak sensitive technical details.

¿Qué gravedad tiene CWE-756?

MITRE no ha publicado una calificación de probabilidad de explotación para esta debilidad. Trátala como de impacto medio hasta que tu modelo de amenazas demuestre lo contrario.

¿Qué lenguajes o plataformas se ven afectados por CWE-756?

MITRE no ha especificado plataformas afectadas para esta CWE — puede aplicar a la mayoría de los stacks de aplicaciones.

¿Cómo puedo prevenir CWE-756?

Use safe-by-default frameworks, validate untrusted input at trust boundaries, and apply the principle of least privilege. Cover the data-flow signature in CI with SAST.

¿Cómo detecta y corrige Plexicus CWE-756?

El motor SAST de Plexicus detecta la firma de flujo de datos para CWE-756 en cada commit. Cuando hay coincidencia, nuestro agente Codex Remedium abre un PR de corrección con el código corregido, las pruebas y un resumen de una línea para el revisor.

¿Dónde puedo aprender más sobre CWE-756?

MITRE publica la definición canónica en https://cwe.mitre.org/data/definitions/756.html. También puedes consultar la documentación de OWASP y NIST para guías relacionadas.

Debilidades relacionadas

Weaknesses related to CWE-756

CWE-755 Padre

Improper Handling of Exceptional Conditions

This vulnerability occurs when software fails to properly manage unexpected situations or errors, leaving it in an unstable or insecure…

CWE-209 Hermano

Generation of Error Message Containing Sensitive Information

This vulnerability occurs when an application reveals sensitive details about its internal systems, user data, or environment within error…

CWE-248 Hermano

Uncaught Exception

This vulnerability occurs when a function throws an error or exception, but the calling code does not have a proper handler to catch and…

CWE-274 Hermano

Improper Handling of Insufficient Privileges

This vulnerability occurs when an application fails to properly manage situations where it lacks the necessary permissions to execute an…

CWE-280 Hermano

Improper Handling of Insufficient Permissions or Privileges

This vulnerability occurs when a system fails to properly manage situations where it lacks the necessary permissions to perform an action…

CWE-333 Hermano

Improper Handling of Insufficient Entropy in TRNG

This vulnerability occurs when a system fails to properly manage the limited or unpredictable output rate of a true random number…

CWE-390 Hermano

Detection of Error Condition Without Action

This weakness occurs when software successfully identifies an error condition but then fails to take any meaningful action to address it.…

CWE-392 Hermano

Missing Report of Error Condition

This vulnerability occurs when a system fails to properly signal that an error has happened. Instead of returning a clear error code,…

CWE-395 Hermano

Use of NullPointerException Catch to Detect NULL Pointer Dereference

Using a try-catch block for NullPointerException as a substitute for proper null checks is an anti-pattern. This approach masks the root…

Listo cuando tú lo estés

Deja de pagar por desarrollador.
Empieza a cerrar el bucle.

Plexicus es el ASPM nativo de IA que escanea, filtra, corrige, pentestea y explica — de forma autónoma. Desarrolladores ilimitados, repos ilimitados, acciones de IA de uso justo. Nivel gratuito real, €269/mo anual cuando estés listo.