Skip to Content
Abstract illustration of error messages leaking sensitive details

Verbose Error Messages

What verbose error messages leak in production, how to spot them during testing, and how to turn them off.

Aug 27, 2025
Updated Nov 22, 2026
2 min read

Description

An application has verbose errors when it sends diagnostic detail back to the user. That can be a stack trace, the failing SQL query, file paths, configuration values, and sometimes secrets such as API keys or connection strings.

Developers need that detail while debugging. In production it is an information disclosure bug. A tester reads it to fingerprint the stack, learn internal paths and class names, and find the weak spot that would otherwise take a lot of guessing.

Some examples:

  • A SQL error names the database engine and often its version.
  • A stack trace shows file paths and class names, which tells you how the backend is laid out.
  • A misconfigured API returns internal identifiers or part of a credential in the error body.

Why it matters

One error page rarely looks dangerous on its own. It often gives just enough context to build a working exploit, for example the exact query shape for a SQL injection payload.


Remediation

  • Return a generic message in production, such as "An error occurred. Please try again later."
  • Write the full stack trace, query and debug detail to server-side logs with restricted access, never to the response.
  • Use different error settings per environment: verbose in development, suppressed in production.
  • Handle errors in one global handler so every route returns the same sanitized response.
  • Validate input at each entry point so malformed requests fail early and cleanly instead of deep in the stack.

References

MITRE ATT&CK techniques

CWE entries

Security resources


Next steps

Related information disclosure notes:

On this page