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

WebOTG-SM-018 — Insecure Configuration of Error Handling

A structured procedure for identifying error-handling configurations that unnecessarily disclose technical information, expose debugging details or provide inconsistent security behavior across application responses.

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

Objective

What are we verifying?

Verify that application error handling provides appropriate information to legitimate users without unnecessarily disclosing implementation details, internal infrastructure information, debugging output or sensitive data.

Error responses are an important part of the application's security boundary. Improperly configured error handling can reveal framework details, filesystem paths, database information, internal hostnames, stack traces, configuration values or other implementation details.

The assessment should distinguish between useful application-level error information and information that materially assists an attacker in understanding or targeting the underlying implementation.

Do not classify every detailed error message as a vulnerability

A technical message is only a meaningful security finding when its disclosure creates a relevant security or privacy risk. Avoid raising findings solely because an error response contains ordinary diagnostic wording.

02 / SCOPE

Scope

Review error behavior generated by:

Invalid request parameters
Invalid resource identifiers
Unsupported HTTP methods
Missing resources
Authentication and authorization failures
Application exceptions
Server-side failures
API error responses
Reverse-proxy and gateway errors
Development and debug error pages
03 / PREREQUISITES

Prerequisites

Authorization Confirm authorization to submit invalid or malformed requests to the target application.
Application architecture Understand the application's major components and error-handling layers where possible.
Environment Determine whether the target is a development, testing, staging or production environment.
Logging access Where authorized, access server or application logs to compare client-visible errors with internal diagnostic records.
04 / METHODOLOGY

Methodology

Generate controlled error conditions and analyze the resulting response. The goal is to determine what information is intentionally exposed to the client and whether sensitive diagnostic information is improperly transferred outside the intended trust boundary.

Review Purpose
HTTP status Determine whether the response uses an appropriate status code for the condition.
Response body Identify stack traces, framework errors, internal paths and implementation details.
Response headers Identify server, framework or debugging information unnecessarily disclosed.
Error consistency Determine whether errors are handled consistently across application layers.
Environment behavior Determine whether production uses development-oriented error handling.
05 / PROCEDURE

Test procedure

01
Establish normal application behavior Capture a normal response so that error responses can be compared against expected application behavior.
02
Generate controlled invalid requests Submit malformed, incomplete or otherwise invalid input within the authorized test scope.
03
Trigger application-level errors Test invalid resource identifiers, unsupported methods and other predictable application error conditions.
04
Inspect the complete response Review status code, response headers and body for unnecessary technical information.
05
Compare client and server diagnostics Where authorized, determine whether detailed diagnostic information remains available in server-side logs without being disclosed to users.
06
Test production configuration Verify that development-mode exception pages, debug output and verbose framework diagnostics are disabled in production.
07
Determine security impact Establish whether the disclosed information provides meaningful assistance for attacking the application or exposes confidential data.
06 / ERROR CATEGORIES

Error categories

Error type Review focus
4xx client errors Confirm that responses provide useful application-level information without exposing implementation details.
5xx server errors Verify that internal exception details are not returned to clients.
Framework exceptions Check for framework names, versions, stack traces and source locations.
Database errors Check whether SQL statements, schema information, database hostnames or driver details are exposed.
Filesystem errors Check for absolute server paths, filenames and deployment structure.
Debug pages Check for interactive debugging tools, environment variables and application internals.
Proxy errors Check whether upstream infrastructure exposes internal service names, addresses or implementation details.

Example insecure response

INSECURE

HTTP 500 response contains a full stack trace, internal filesystem path, framework details and database exception information.

PREFERRED

HTTP 500 response returns a generic application error and a correlation identifier while detailed diagnostics remain server-side.

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

{
    "error": "An unexpected error occurred.",
    "request_id": "7f21c4..."
}
07 / ASSESSMENT

Assessment

Condition Assessment consideration
Generic application error Normally appropriate when internal diagnostics remain server-side.
Detailed but non-sensitive message Determine whether disclosure creates a meaningful security impact.
Framework information Assess whether the information materially assists fingerprinting or exploitation.
Stack trace Determine whether source locations, internal paths or sensitive values are disclosed.
Credentials or secrets Treat as a potentially serious information-disclosure issue and assess the exposed secret immediately.
Production debug interface Assess separately where debugging functionality provides interactive access or sensitive application information.
08 / EXPECTED RESULT

Expected result

Pass condition

Error responses provide sufficient information for legitimate users and clients to understand the failure while preventing unnecessary disclosure of internal implementation, infrastructure and sensitive diagnostic information.

Detailed diagnostics should remain available through appropriate server-side logging and monitoring mechanisms rather than being returned directly to untrusted clients.

09 / FAILURE CRITERIA

Failure criteria

Production responses disclose stack traces or detailed internal exception information.
Error responses expose sensitive filesystem paths, internal service names or infrastructure details.
Database errors disclose queries, schema details, connection information or sensitive database data.
Debug or development error pages are exposed to untrusted users in a production environment.
Error handling exposes credentials, API keys, tokens or other sensitive configuration information.
Different application layers expose inconsistent diagnostic information that materially increases information disclosure.
Example finding INFORMATION DISCLOSURE

A production application returns detailed server exception information to the client when an application error occurs. The response reveals internal implementation details that should remain within the server-side diagnostic boundary.

10 / REMEDIATION

Remediation

Separate client-facing error handling from internal diagnostic logging. Users should receive controlled responses while authorized operators retain sufficient diagnostic information for troubleshooting.

Recommended approach

  1. Disable development-mode exception pages in production.
  2. Implement centralized application error handling where practical.
  3. Return generic client-facing messages for unexpected server-side failures.
  4. Keep detailed stack traces and diagnostics in server-side logs.
  5. Ensure sensitive values are excluded from logs as well as client responses.
  6. Use correlation or request identifiers to connect client errors with internal diagnostics.
  7. Configure reverse proxies and gateways so their error pages do not disclose internal infrastructure.
  8. Apply consistent error handling across web pages, APIs and background service interfaces.
  9. Review error behavior after framework or server upgrades.
  10. Monitor error responses for unexpected disclosure.

Example server-side handling model

Conceptual flow EXAMPLE
Application exception
        |
        +----> Internal diagnostic log
        |          |
        |          +-- exception details
        |          +-- stack trace
        |          +-- request ID
        |
        +----> Client response
                   |
                   +-- safe error message
                   +-- request ID
                   +-- appropriate HTTP status
Logging is not a substitute for secure error handling

Moving diagnostic information into logs is only appropriate when those logs are themselves protected, access-controlled and handled according to the organization's security and retention requirements.

11 / VERIFICATION

Verification

01
Repeat the original error condition Reproduce the previously identified application error using the same authorized test case.
02
Inspect the client response Confirm that stack traces, internal paths, sensitive configuration and unnecessary implementation details are no longer disclosed.
03
Verify server-side diagnostics Where authorized, confirm that operators can still obtain sufficient diagnostic information through protected logging or monitoring.
04
Test multiple error paths Verify that the fix applies consistently to application, API, proxy and framework-generated errors.
05
Verify production mode Confirm that the deployed environment does not accidentally use development or debug error handling.
06
Verify application functionality Confirm that legitimate error messages remain understandable and that normal application functionality is unaffected.
PASS

Client-facing errors are appropriately controlled and internal diagnostics remain protected.

FAIL

Material technical or sensitive information remains exposed through error handling.

NOT TESTED

Error-handling behavior could not be adequately reproduced or verified.

12 / EVIDENCE

Evidence requirements

Test case used to trigger the error
HTTP status code
Relevant response headers
Client-visible response content
Sensitive information identified, if any
Before-remediation evidence
Error-handling configuration
Post-remediation response
Server-side diagnostic verification where authorized
Final PASS / FAIL determination
Never publish live secrets as evidence

Redact credentials, tokens, session identifiers, database connection strings, internal addresses, personal information and other sensitive values from screenshots, response captures and reports.

13 / CLASSIFICATION

Classification

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

WebOTG-SM-018 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 Testing methodology for information disclosure and application behavior.
OWASP Application Security Verification Standard Application security verification requirements relevant to secure error handling.
Application framework security guidance Configuration requirements for production exception handling and diagnostic output.
Organizational logging standard Defines requirements for protected server-side diagnostic information.

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.