Application Error Disclosure

ID

application_error_disclosure

Severity

high

Kind

Information Disclosure

CWE

550

Description

Application Error Disclosure occurs when a web application returns error or warning messages that reveal sensitive internal information such as stack traces, file paths, database queries, or server configuration details. This information leakage typically results from unhandled exceptions or misconfigured error handling in production environments.

Rationale

Detailed error messages give attackers insight into the application’s internal architecture, technology stack, and file system layout, significantly reducing the effort needed to identify and exploit further vulnerabilities. An attacker can deliberately trigger errors to map out backend components, discover database schema details, or pinpoint specific software versions with known security flaws.

In regulated industries, exposing such internal details through error responses may also constitute a compliance violation under standards like PCI-DSS, HIPAA, or GDPR.

Remediation

Configure the application and its underlying framework to suppress detailed error output in production environments. All unhandled exceptions should be caught by a global error handler that returns a generic, user-friendly error page without exposing any technical details.

Implement custom error pages for common HTTP error codes (400, 403, 404, 500) that provide a consistent, neutral message to the end user. Consider including a unique error reference identifier in the response so that users can report issues while the corresponding technical details remain logged server-side only.

Set up centralized logging to capture full exception details, stack traces, and request context on the server. Review these logs regularly to identify and fix the root causes of recurring errors rather than relying on client-visible messages for debugging.