Mishandling of exceptional conditions: when the error path is the weak spot

Mishandling of exceptional conditions is A10 in the OWASP Top 10:2025, a category new to this edition. It describes software that copes badly when something unusual happens: an input nobody planned for, a service that does not answer, a check that throws an error. The flaw is in the application's code, so the fix is too. A request filter sees little of it.

Section Rules Updated OWASP A10:2025

Quick facts

Category
A10:2025 Mishandling of Exceptional Conditions, new in the 2025 edition
Mapped weaknesses
24 CWEs, among them CWE-209, CWE-248, CWE-636 and CWE-756
In the contributed data
769,581 occurrences and 3,416 CVEs across the mapped CWEs
Typical causes
Weak input validation, error handling that is late or inconsistent, unhandled exceptions, unexpected environment states
Does a WAF stop it?
Not the flaw. A filter can refuse some malformed requests and slow repeated attempts, but how errors are handled stays in the application

Figures are from the A10:2025 page of the OWASP Top 10.

What the category covers

Every program meets situations its authors did not plan around. A user submits an empty field. A database connection drops halfway through a task. A file arrives bigger than expected. OWASP groups the failures to prevent, detect and respond to such situations in one category, because they share an outcome: crashes, behaviour nobody intended, and sometimes a vulnerability.

OWASP names the usual causes.

  • Input checks that are missing or weak. The odd value reaches code that never expected it.
  • Handling that comes late or sits too high. An error is caught far from where it happened, after state has already been changed.
  • Unexpected environment states. Memory, permissions or the network are not what the code assumed.
  • Inconsistent exception handling. Some paths are careful and others are not.
  • Exceptions nobody handles at all.

The category is a split. OWASP carved it out of broader code-quality problems, which is why it overlaps in places with security misconfiguration (verbose errors are in both) and with insecure design (a flow that was never designed to fail safely).

OWASP gives three attack scenarios for A10:2025:

  • Resources never released. If an upload throws an exception and the code does not free what it locked, each failed attempt leaves resources unavailable, and the result is a denial of service.
  • Detailed database errors shown to the user. The message reveals system information that an attacker uses to plan a SQL injection.
  • A multi-step transfer interrupted without a full rollback. The account can be drained, or a payment repeated through a race condition.

Failing open and failing closed

The most useful idea in this category is short. When a security decision cannot be made because something went wrong, the system has to pick a default. Failing closed denies the action. Failing open allows it.

CWE-636, Not Failing Securely ('Failing Open'), names the second choice as a weakness. An illustration: a function asks the permissions service whether a user may export a report. The service times out. If the calling code treats "no answer" as "no objection", every user who hits that timeout can export. Nothing was attacked and nothing was bypassed; the code did what it was told, and nobody told it what to do on failure.

OWASP's advice for the multi-step case is the same instinct applied to state: roll back the incomplete transaction instead of attempting partial recovery. A half-finished operation is a state that nobody tested.

The pattern turns up wherever a decision depends on a call that can fail: sign-in checks, feature flags, payment confirmations, signature verification. Reviewing them for the question "what happens when this call errors?" finds more than reviewing the happy path ever will. The same review catches some business logic flaws, which also live in what the application allows rather than in any one request.

Errors that say too much

The second face of the category is what the visitor is shown. A stack trace names files, libraries and versions. A database error can quote part of the query. A debug page can list configuration. Several mapped CWEs describe exactly this: CWE-209 and CWE-550 cover error messages that contain sensitive information, CWE-215 covers sensitive information inserted into debugging code, and CWE-756 covers a missing custom error page, meaning the framework's default page is what users get.

The fix has two halves. Users get a message they can act on and no internals. The detail goes to logs, where the people running the system can read it. For the logging half, see logging and alerting failures, the neighbouring category in the same edition.

HTTP itself gives the application a vocabulary for this. A server-side failure belongs in the 5xx class (RFC 9110, section 15.6); a body that explains which line failed does not. A page that returns 200 with an error message inside also hides failures from monitoring, because the status code says all is well.

The 24 mapped weaknesses

OWASP maps 24 CWEs to A10:2025. Grouped by what goes wrong, they read as follows.

GroupCWEs
Messages and pages that reveal209 Error message with sensitive information; 550 Server-generated error message with sensitive information; 215 Sensitive information in debugging code; 756 Missing custom error page
Errors caught badly or not at all248 Uncaught exception; 252 Unchecked return value; 390 Error condition without action; 391 Unchecked error condition; 394 Unexpected status code or return value; 396 Catch of generic exception; 397 Throws of generic exception
Missing input and cleanup234 Missing parameter; 235 Extra parameters; 460 Improper cleanup on thrown exception
Privilege failures274 Insufficient privileges; 280 Insufficient permissions or privileges
Coding slips369 Divide by zero; 476 NULL pointer dereference; 478 Missing default case; 484 Omitted break in switch
General handling636 Not failing securely; 703 Improper check or handling of exceptional conditions; 754 Improper check for unusual conditions; 755 Improper handling of exceptional conditions

Most of these are never visible from outside. A divide-by-zero or an omitted break statement is found by reading code or by testing, not by looking at traffic.

What fixes it

OWASP's prevention list is mostly engineering practice.

  • Catch errors where they occur. Then handle them in a way that means something, not with an empty catch block.
  • Keep a global exception handler. It is the safety net for what the local handlers missed, and it is the one place that decides what a user may see.
  • Fail closed. Roll back incomplete transactions rather than recovering part of them.
  • Validate input strictly and handle errors centrally. The same rules everywhere, not one convention per developer.
  • Log, and alert when it is justified. Repeated errors can mean someone is probing.
  • Limit what can trigger the condition. OWASP lists rate limiting, quotas and throttling.
  • Test the failures. Security requirements, threat modelling, code review, stress tests and penetration tests all appear in the list.

For day-to-day practice, OWASP's Error Handling Cheat Sheet goes into more detail than the Top 10 entry.

Where a WAF helps and where it does not

A filter sits in front of the application and reads requests. Fail-open logic, a leaked resource or a missing rollback never appear in a request, so on the core of this category it has nothing to act on.

Where it can help is at the edges.

  • Malformed requests. The OWASP Core Rule Set includes protocol-enforcement rules (REQUEST-920) that refuse requests breaking HTTP rules before the application tries to parse them. Parsing code is where many unhandled exceptions start.
  • Repeated attempts. If someone sends request after request to provoke errors, rate limiting applied per domain raises the cost of doing it. OWASP lists rate limiting among its measures for this category.
  • Response rules in the Core Rule Set. The RESPONSE-95x files look for data leaks such as error output. This page makes no claim about how Bridge WAF applies response-side inspection.

Where it cannot help is the larger share. It cannot add a global exception handler, make a decision fail closed, release a lock, or roll back a transfer. Replacing a default error page is a server or application setting, and this site does not describe Bridge WAF as the place to do it. The activity log records requests the WAF flagged; it is not a record of the application's own errors, which belong in the application's logs.

If you do turn on rules that touch malformed input, start in monitor mode. Odd but legitimate requests exist, from old clients, from integrations with their own quirks, from forms that submit unexpected fields, and false positives are cheaper to find while nothing is refused. The monitor mode page explains how to read what would have matched.

Questions

What is mishandling of exceptional conditions?

It is OWASP's A10:2025 category for failures to prevent, detect and respond to unusual situations in an application, such as unhandled exceptions, missing input validation and error handling that fails open. It is new in the 2025 edition.

Can a WAF fix mishandling of exceptional conditions?

No. The weakness is in how the application handles errors, and a WAF in front of it does not change that code. A WAF can refuse some malformed requests and apply rate limits, which reduces how often an error can be triggered.

What does failing open mean?

Failing open means that when a check errors out, the system lets the action proceed instead of denying it. CWE-636 calls this not failing securely. The safe default is to fail closed: deny when the outcome cannot be determined.

How many CWEs map to A10:2025?

Twenty-four, including CWE-209 on error messages with sensitive information, CWE-248 on uncaught exceptions, CWE-636 on failing open and CWE-756 on a missing custom error page.

Should a production site show stack traces?

No. OWASP's guidance is to give users understandable error messages, put the detail in logs, and keep a global exception handler as a safety net. In OWASP's own example, detailed database errors helped an attacker plan a SQL injection.