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

WebOTG-SM-007 — Error Handling and Information Disclosure

A structured procedure for identifying excessive technical information exposed through application errors, exception messages, debug responses and diagnostic interfaces.

WebOTG ID SM-007 OWASP A02:2025 Type Information Disclosure Method Error Handling Review Version 1.0
01 / OBJECTIVE

Objective

What are we verifying?

Verify that application errors do not unnecessarily disclose sensitive implementation details, internal paths, infrastructure information, debugging data, credentials or other information that could assist an attacker.

Error handling is part of the application's security boundary. Invalid requests, malformed input, missing resources and unexpected application failures should result in controlled responses appropriate for the deployment environment.

Production systems should not expose development diagnostics merely because an unexpected condition occurs.

Error messages are not automatically vulnerabilities

A generic error message is not always necessary, and a detailed error can sometimes be legitimate. Assess whether the disclosed information creates meaningful security impact rather than treating every technical message as a vulnerability.

02 / SCOPE

Scope

Review error behavior across representative application surfaces, including:

Public application pages
Authentication and account pages
Administrative interfaces
API endpoints
Invalid URL and resource requests
Input validation failures
Authentication and authorization failures
Server-side application exceptions
Debug and diagnostic endpoints
03 / PREREQUISITES

Prerequisites

Authorization Confirm authorization to generate controlled application errors.
Test environment Prefer a dedicated test environment where malformed requests can safely be generated.
Application architecture Identify application servers, frameworks, reverse proxies and error-handling layers.
Logging access Obtain authorized access to server or application logs where required to distinguish client-safe errors from internal diagnostics.
04 / METHODOLOGY

Methodology

Generate controlled invalid conditions and inspect the resulting response. The objective is to determine whether the client receives only the information necessary to understand the failure.

Method Purpose
Invalid request testing Determine how malformed requests are handled.
Resource error testing Review 4xx and 5xx responses for unnecessary technical information.
Exception testing Determine whether unexpected server failures expose debugging information.
Configuration review Determine whether production debugging or verbose exception handling is enabled.
05 / PROCEDURE

Test procedure

01
Establish a normal baseline Capture the normal response for a representative application request.
02
Request a nonexistent resource Request an authorized test path that does not exist and inspect the resulting error response.
03
Submit malformed input Use controlled invalid input appropriate to the endpoint and observe the application's response.
04
Trigger controlled server errors Where the test environment permits it, generate an expected application exception or invalid processing condition.
05
Inspect response content Look for stack traces, file paths, framework versions, SQL details, internal hostnames, configuration data and debugging information.
06
Compare environments Confirm that production behavior differs from development diagnostics where appropriate.
06 / ERROR TYPES

Information to look for

Information Security concern
Stack traces May reveal application structure, source locations and implementation details.
Absolute file paths May disclose server filesystem structure.
Database errors May disclose database technology, schema information or query details.
Internal hostnames May expose internal infrastructure information.
Software versions May assist technology fingerprinting and vulnerability research.
Configuration values May disclose sensitive deployment information or secrets.
Debug panels May expose extensive application state and privileged diagnostic information.

Example unsafe response

Illustrative response UNSAFE
HTTP/1.1 500 Internal Server Error
Content-Type: text/html

RuntimeException:
Database connection failed

File:
 /var/www/application/src/Database/Connection.php

Framework:
 ExampleFramework 4.x

Stack trace:
 #0 /var/www/application/src/...
 #1 /var/www/application/src/...

The example is intentionally generic. The security concern is the unnecessary disclosure of internal implementation and infrastructure information to the client.

Example controlled response

Illustrative response PREFERRED
HTTP/1.1 500 Internal Server Error
Content-Type: application/json

{
    "error": "An unexpected error occurred.",
    "request_id": "8f42c1..."
}

Detailed diagnostics should be retained in appropriate protected server-side logs rather than returned directly to an untrusted client.

07 / ASSESSMENT

Assessment

Condition Assessment
Generic client-safe error Generally appropriate when detailed diagnostics are unnecessary to the client.
Correlation/request identifier Useful when it allows support teams to locate server-side diagnostics without exposing those diagnostics.
Stack trace exposed Assess disclosed information and whether it creates meaningful attack value.
Internal filesystem path exposed Record the information disclosed and determine whether it assists further attacks.
Secrets or credentials exposed Treat as a serious information disclosure requiring immediate containment and credential rotation where applicable.
08 / EXPECTED RESULT

Expected result

Pass condition

Error responses provide clients with only the information necessary for the intended interaction, while detailed diagnostics remain protected within server-side logging and monitoring systems.

Production responses should not expose stack traces, source-code locations, internal infrastructure details, database diagnostics, secrets or debugging interfaces.

09 / FAILURE CRITERIA

Failure criteria

Production responses expose server-side stack traces.
Internal filesystem paths are unnecessarily disclosed.
Database errors disclose sensitive implementation or schema information.
Internal hostnames or infrastructure details are unnecessarily returned.
Debug mode exposes detailed application state.
Error responses expose credentials, tokens, connection strings or other secrets.
Example finding INFORMATION DISCLOSURE

A production application returns a detailed server-side exception containing an absolute filesystem path and framework implementation details. The same information is not required for the user to understand the failure.

10 / REMEDIATION

Remediation

Implement centralized exception handling that separates information intended for the client from diagnostic information intended for authorized operators.

Recommended approach

  1. Disable development/debug output in production.
  2. Implement centralized exception handling.
  3. Return generic client-safe error messages.
  4. Log detailed diagnostic information on the server.
  5. Restrict access to diagnostic logs and monitoring systems.
  6. Remove secrets from exception messages and logs.
  7. Review framework and web-server error pages.
  8. Configure consistent handling for application, proxy and server-generated errors.
  9. Use request or correlation identifiers to connect client errors with protected server-side diagnostics.
  10. Test error handling after every major deployment configuration change.

Example application response

Illustrative application behavior EXAMPLE
try {
    processRequest();
} catch (Throwable $e) {

    $requestId = createRequestId();

    logException($requestId, $e);

    return jsonResponse(
        500,
        [
            "error" => "An unexpected error occurred.",
            "request_id" => $requestId
        ]
    );
}

The implementation above is conceptual. The exact exception-handling mechanism depends on the application's language and framework.

11 / VERIFICATION

Verification

01
Repeat the original error tests Reproduce the same invalid requests and error conditions used during the initial assessment.
02
Inspect client responses Confirm that stack traces, internal paths, diagnostics and sensitive implementation details are no longer returned.
03
Verify server-side logging Confirm that authorized operators can still obtain sufficient diagnostic information from protected logs.
04
Verify secret handling Confirm that credentials, tokens and connection secrets are not included in client responses or inappropriate logs.
05
Verify production configuration Confirm that debug/development modes remain disabled after deployment and restart.
PASS

Client responses are controlled and detailed diagnostics remain protected.

FAIL

Sensitive implementation or diagnostic information remains exposed.

NOT TESTED

The relevant error condition or environment could not be adequately verified.

12 / EVIDENCE

Evidence requirements

Application and environment tested
Error condition reproduced
HTTP response before remediation
Information disclosed before remediation
Remediation evidence
HTTP response after remediation
Server-side diagnostic verification
Final PASS / FAIL determination
Do not publish sensitive error output

Before publishing evidence, remove passwords, credentials, tokens, connection strings, private addresses and other sensitive information. If the finding itself contains a secret, treat the secret as compromised and follow the organization's incident and credential-rotation procedures.

13 / CLASSIFICATION

Classification

WebOTG procedure WebOTG-SM-007
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 of the information disclosed and its practical security impact.
WebOTG classification notice

WebOTG-SM-007 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 Application security verification requirements related to error handling, information exposure and secure implementation.
OWASP Error Handling Cheat Sheet Guidance for secure application error handling and information disclosure.
Vendor framework documentation Production error handling and debug configuration requirements.

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.