WebOTG Security Testing Library ● Public reference
WebOTG
WEBOTG SECURITY TESTING PROCEDURE

WebOTG-SM-013 — Excessive Error Information Disclosure

A structured procedure for identifying application errors that disclose unnecessary implementation, configuration or operational information to users or other untrusted parties.

WebOTG ID SM-013 OWASP A02:2025 Type Error Handling Method Error Response Review Version 1.0
01 / OBJECTIVE

Objective

What are we verifying?

Verify that application error responses provide sufficient information for legitimate users while preventing unnecessary disclosure of internal implementation, configuration or security-sensitive details.

Applications inevitably encounter invalid requests, failed operations and unexpected conditions. Error handling becomes a security concern when responses expose information that an untrusted user does not need to know.

Examples include stack traces, source-code locations, internal hostnames, filesystem paths, database details, framework diagnostics, configuration values and debugging information.

Detailed errors belong in controlled diagnostic channels

Developers and operators may require detailed diagnostic information. That does not mean those details should be returned to public clients. Diagnostic information should normally be captured through controlled server-side logging or monitoring.

02 / SCOPE

Scope

Review error handling across:

Public web pages
Authenticated application functions
Administrative interfaces
REST and JSON APIs
File upload and processing functions
Authentication and authorization failures
Database and backend failures
Reverse proxy and gateway error responses
Production exception handling
03 / PREREQUISITES

Prerequisites

Authorization Confirm explicit authorization to perform application security testing.
Test environment Prefer a non-production environment where testing can safely generate controlled application errors.
Application documentation Identify supported error-handling behavior and expected client-facing responses.
Logging access Where available, obtain authorized access to server-side logs for comparison between client-visible and internal diagnostics.
04 / METHODOLOGY

Methodology

Generate controlled error conditions and inspect the resulting client response. Determine whether the response contains information unnecessary for the client to understand or recover from the error.

Method Purpose
Invalid input testing Determine how the application handles malformed or unexpected input.
Invalid resource testing Review responses for nonexistent or unavailable resources.
Authentication testing Review information disclosed during authentication failures.
API response review Determine whether structured error responses disclose internal details.
Configuration review Verify that production diagnostic or debug modes are not unnecessarily exposed.
05 / PROCEDURE

Test procedure

01
Establish normal error behavior Identify the application's documented or expected client-facing error format.
02
Generate controlled invalid requests Use authorized test inputs to trigger predictable validation, routing and processing errors.
03
Inspect the response Review the HTTP status, headers, response body and client-visible diagnostic information.
04
Identify internal information Determine whether the response exposes implementation, infrastructure or diagnostic information unnecessary to the client.
05
Compare with server-side diagnostics Where authorized, compare client-visible errors with server-side logs to verify that detailed diagnostics remain on the controlled side of the security boundary.
06
Review production configuration Verify that debug, development or verbose exception modes are not enabled unnecessarily.
06 / ERROR TYPES

Error categories

Error type Review focus
Validation error Ensure the response explains the invalid input without exposing internal processing details.
Authentication error Avoid unnecessary information about authentication internals or account processing.
Authorization error Return an appropriate access-denied response without revealing sensitive implementation information.
Database error Do not expose SQL statements, database schema details, connection information or backend diagnostics.
Application exception Do not expose stack traces, source paths, class names or internal exception details.
Gateway / server error Ensure infrastructure errors do not unnecessarily disclose server software, topology or internal paths.

Example of excessive disclosure

Client response EXAMPLE
{
    "error": "DatabaseException",
    "message": "Query failed",
    "sql": "SELECT * FROM users WHERE id = ?",
    "database": "production_users",
    "host": "db-internal-02",
    "source": "/var/www/app/src/UserRepository.php:184",
    "trace": "..."
}

The client generally does not require the SQL statement, internal database name, internal hostname, source path or stack trace to understand that the request failed.

Preferred client-facing response

Client response EXAMPLE
{
    "error": "request_failed",
    "message": "The request could not be completed.",
    "request_id": "8f31c2a1"
}

Detailed diagnostic information should remain in controlled server-side logging and be associated with the request identifier where appropriate.

07 / ASSESSMENT

Assessment

Information disclosed Assessment consideration
Generic error message Normally acceptable if sufficient for legitimate client handling.
Request identifier Generally useful for support and server-side correlation.
Framework or library details Determine whether disclosure is necessary and whether it increases unnecessary information exposure.
Filesystem paths Generally unnecessary for clients and should not be disclosed.
Stack traces Should normally remain server-side.
SQL statements Should not normally be returned to untrusted clients.
Internal hostnames Review whether disclosure is necessary; internal infrastructure information should generally remain private.
Secrets or credentials Treat as a serious security finding and initiate appropriate incident handling if actual secrets were exposed.
08 / EXPECTED RESULT

Expected result

Pass condition

Client-facing error responses disclose only the information necessary for legitimate application behavior and support, while detailed diagnostic information remains within controlled server-side logging and monitoring systems.

Production systems should not expose development diagnostics such as stack traces, source locations, debugging panels or backend exception details to untrusted clients.

09 / FAILURE CRITERIA

Failure criteria

Production responses expose stack traces or detailed exception diagnostics.
Responses expose server filesystem paths or source code locations.
Database errors disclose SQL statements, schema information or backend connection details.
Internal infrastructure hostnames or topology are unnecessarily exposed.
Debug or development error pages are accessible in production.
Error responses expose credentials, tokens, keys or other security-sensitive secrets.
Example finding INFORMATION DISCLOSURE

A production application returns a detailed exception response containing an internal filesystem path and source-code location. These details are not required by the client and provide unnecessary implementation information to an untrusted party.

10 / REMEDIATION

Remediation

Separate client-facing error handling from internal diagnostics. The client should receive a controlled error representation, while detailed diagnostic information should be captured through protected operational channels.

Recommended approach

  1. Implement centralized exception and error handling.
  2. Disable verbose production error output.
  3. Return generic client-safe error messages.
  4. Use stable error codes where appropriate.
  5. Generate a request or correlation identifier for troubleshooting where appropriate.
  6. Record detailed diagnostic information in protected server-side logs.
  7. Ensure sensitive values are excluded from logs as well as client responses.
  8. Configure framework and reverse-proxy error pages appropriately for production.
  9. Apply consistent handling across HTML and API responses.
  10. Re-test error paths after deployment configuration changes.

Example error-handling model

Illustrative flow EXAMPLE
Application error
       |
       v
Central error handler
       |
       +----------------------+
       |                      |
       v                      v
Server-side log         Client response
       |                      |
Detailed diagnostics     Safe error message
       |                      |
Request ID  <-------------+
       |
       v
Authorized operations team
Do not simply suppress every error

Removing useful error information from the client without preserving diagnostic capability creates operational problems. The correct approach is to separate client-safe information from protected internal diagnostics.

11 / VERIFICATION

Verification

01
Trigger controlled errors Generate authorized validation, routing and processing errors in the test environment.
02
Inspect client responses Confirm that stack traces, source paths, SQL statements and unnecessary internal diagnostics are absent.
03
Verify error status handling Confirm that appropriate HTTP status codes and application error structures are returned.
04
Verify diagnostic logging Confirm that authorized operators can still locate sufficient server-side diagnostic information for troubleshooting.
05
Verify production configuration Confirm that debug and development error modes remain disabled in the deployed production configuration.
06
Verify all application paths Repeat the review for web pages, APIs, authentication flows and relevant gateway error responses.
PASS

Client responses are appropriately sanitized while diagnostic information remains available through controlled channels.

FAIL

Unnecessary internal or security-sensitive information is exposed through client-facing error responses.

NOT TESTED

Error-handling behavior or production configuration could not be adequately verified.

12 / EVIDENCE

Evidence requirements

Test case used to generate the error
HTTP status and response structure
Client-visible error content
Evidence of remediation
Post-remediation response
Production debug configuration
Server-side diagnostic logging evidence
Final PASS / FAIL determination
Sanitize diagnostic evidence

Evidence must not publish passwords, API keys, session tokens, connection strings, private infrastructure details or other secrets. Redact sensitive values before attaching evidence to a public or externally shared assessment record.

13 / CLASSIFICATION

Classification

WebOTG procedure WebOTG-SM-013
OWASP category A02:2025 — Security Misconfiguration
Procedure type Error handling and information disclosure review
Assessment result PASS / FAIL / NOT TESTED
Finding severity Determine from the sensitivity and usefulness of the disclosed information, exposure and resulting security impact.
WebOTG classification notice

WebOTG-SM-013 is a WebOTG-defined verification procedure. The identifier is not an OWASP-defined test identifier.

14 / REFERENCES

References

Source Relevance
OWASP Top 10:2025 — A02 Security Misconfiguration category.
OWASP Web Security Testing Guide Web application security testing methodology.
OWASP Application Security Verification Standard Verification requirements related to secure error handling and information exposure.
Application error-handling policy Organization-specific requirements for client-facing errors and diagnostic logging.
Production deployment configuration Verification of debug and diagnostic configuration in deployed environments.

WebOTG should maintain official source URLs, source versions and review dates through its content-management system so references can be updated independently of the procedure template.