Information Disclosure (Error Message)
Summary
This is the error-triggered instance of information disclosure: sending malformed, oversized, or otherwise unexpected input causes the application to fail in a way that reveals more than a generic error should. A "Whitelabel Error Page" or default 500 response is meant to hide implementation detail from the user, but many frameworks, when not explicitly configured for production, instead render a full stack trace, source file paths, the exact framework and version in use, or in the more severe cases (Werkzeug's interactive debugger, ASP.NET's Yellow Screen of Death) an interactive console with live code execution. Unlike information exposure through debug information, which is a standing endpoint reachable at any time, this category specifically requires triggering the error first: the leak only happens as a side effect of the application failing to handle unexpected input gracefully.
Top Affected Components / Targets
- Default framework error pages left unconfigured for production (Whitelabel Error Page, Werkzeug debugger, ASP.NET Yellow Screen of Death, Express stack traces)
- API endpoints that pass unexpected input types directly into internal logic without a validation layer catching it first
- Database-backed endpoints where a malformed query parameter surfaces a raw SQL error instead of a generic failure message
Common Attack Vectors
- Submit malformed input across content types and parameters (invalid JSON, oversized strings, wrong data types, malformed UUIDs, unexpected null values) and inspect whichever error response comes back for stack traces, file paths, or version banners
- Submit input specifically designed to trigger a database-layer error (an unescaped quote, a type mismatch) to check whether the raw database error message reaches the response instead of being caught and replaced with a generic one
Common Payloads
- Malformed JSON bodies, oversized strings well beyond expected field lengths, invalid UUIDs, and other special characters in fields with narrow expected formats
- A single unescaped quote character in a parameter that reaches a database query, to check for a raw SQL error leak
Detection Strategy
Systematically send malformed variants of every input type (wrong data type, oversized value, invalid format, unexpected special characters) to every discovered parameter and endpoint, then parse each error response for stack-trace patterns, file system paths, framework and version banners, or raw database error text. This is a deterministic, low-noise check: a production application should never leak this level of detail regardless of what garbage input it's handed, so any instance found is a real, actionable configuration gap rather than a borderline judgment call.
Tip: Testing tools that run these checks in parallel across every discovered endpoint can cut the time required substantially compared to fully manual testing, as long as they confirm findings with more than one signal to keep the false-positive rate down.
False-Positive Notes
Some frameworks include a generic, non-identifying error code or reference number in their production error pages by design, which is not itself a leak; the finding requires the response to include genuinely internal detail (file paths, stack frames, framework internals, raw query text) rather than an opaque reference a support team could look up separately.
How to Test
Manual Testing Methodology
Here is a systematic approach to identifying Information Disclosure (Error Message) vulnerabilities in a target application.
Before testing, map all input vectors that could be affected. Identify parameters, headers, cookies, and request bodies that interact with the vulnerable component. A proxy such as Burp Suite or OWASP ZAP, paired with normal browsing of the target, is usually enough to build this list.
Send a legitimate request and record the normal response: status code, content length, response time, and any identifying tokens. This baseline matters because it's what you'll compare later responses against once payloads are involved.
Inject test payloads into each identified input vector one at a time. Start with benign detection payloads before escalating to anything that could actually trigger the vulnerability. For Information Disclosure (Error Message) specifically, trigger error conditions deliberately (malformed input, missing parameters, invalid content types) across every endpoint, and diff full API responses against what the client UI actually uses to spot over-fetched fields.
Compare the response against your baseline, looking specifically for stack traces, internal paths, query fragments, or extra object fields appearing in a response that a production client was never meant to receive.
Once a potential vulnerability is detected, confirm it with at least a few independent test cases to rule out coincidence. Document the exact request and response as proof. For Information Disclosure (Error Message), a confirmed finding typically means showing that attacker-controlled input changes the application's behavior in a way that matters for security, not just that a payload was reflected somewhere harmless.
Real-World Impact
Real-World Impact
Information disclosure covers a wide range of severity on its own — a verbose error message, a debug endpoint left enabled in production, or an API response that returns more fields than the client needs can each range from a minor hygiene issue to a direct path toward a more serious exploit, depending on exactly what leaks.
Stack traces and debug output routinely reveal framework versions, internal file paths, and database query structure that meaningfully narrow down what an attacker needs to guess for a follow-on attack like SQL injection or a known-CVE exploit. API responses that over-fetch — returning an entire internal object instead of an explicit response schema — have repeatedly leaked fields like internal user IDs, other users' partial data, or feature flags that were never meant to be client-visible.
Because each individual disclosure often looks low-severity in isolation, this class is frequently under-triaged relative to its role as a reconnaissance and chaining primitive in a larger attack.
Prevention & Remediation
Prevention and Secure Coding
Preventing Information Disclosure (Error Message) takes a defense-in-depth approach — no single control below is sufficient alone, but together they close off both the primary path and the most common bypasses.
Generic errors to the client, full detail server-side only. Return a generic error message and a correlation ID to the client; log the full stack trace and context server-side where the client can't reach it.
Disable debug/development modes in production. Framework debug modes, verbose stack traces, and admin/debug endpoints should be unreachable in a production deployment, enforced by configuration that's verified as part of the deploy process, not just documented.
Explicit response schemas. Define exactly which fields an API response returns rather than serializing an internal model object directly — this prevents new internal fields from becoming externally visible the moment someone adds them to the model.
Strip identifying metadata. Remove version banners, framework comments, and internal hostnames from responses and headers where they serve no client-facing purpose.