Skip to main content

OWASP Top 10 2025 A10: mishandling exceptional conditions and the fail-open bug

The OWASP Top 10:2025 added a category that most teams had never filed a bug under: A10, Mishandling of Exceptional Conditions. It covers what code does when something unexpected happens, such as a timeout, a missing header, a null, or a dependency that throws. The security question is simple. When the check itself fails, does the request get through?

Most fail-open bugs are not exotic. They are a catch block someone wrote during an outage, a default value in a lookup table, or an assert that disappears in production. This post covers what A10 includes, the five shapes that show up in real code, and how to review for them.

What A10:2025 covers

The A10:2025 page describes software that fails to prevent, detect or respond properly to unusual situations, and maps 24 CWEs to the category. The notable ones are:

CWE Name What it looks like in code
CWE-636 Not Failing Securely ("Failing Open") A catch that returns true from an authorization check
CWE-209 Error Message Containing Sensitive Information res.json(err) with the stack and SQL text
CWE-234 Failure to Handle Missing Parameter A missing signature header that skips verification
CWE-274 Improper Handling of Insufficient Privileges A permission exception swallowed into a log line
CWE-476 NULL Pointer Dereference A crash path an attacker can trigger on demand

The OWASP page lists three example scenarios: resources not released after failed uploads (denial of service), verbose database errors that help an attacker shape SQL injection, and an interrupted multi-step transfer with no rollback. Its prevention advice is to catch errors where they occur, handle them meaningfully, keep a global exception handler as a safety net, and roll back incomplete transactions instead of resuming them.

Shape 1: the catch block that grants access

This is the classic fail-open. The policy service times out, the catch block was written to keep users working, and every request is now authorized.

public boolean canAccess(User user, Document doc) {
    try {
        return policyClient.check(user.id(), doc.id(), "read");
    } catch (Exception e) {
        log.warn("policy service unavailable", e);
        return true; // keep users working during an outage
    }
}

An attacker does not need to break the policy service. They only need to make the check throw: a malformed document id, an oversized request, or load at the right moment. The fix is to catch only the exception you expect and to deny on it. Everything else propagates to the global handler and becomes a 500.

public boolean canAccess(User user, Document doc) {
    try {
        return policyClient.check(user.id(), doc.id(), "read");
    } catch (PolicyTimeoutException e) {
        log.error("policy check timed out for document {}", doc.id(), e);
        return false;
    }
}

The same bug has a quieter form: a guard that throws AccessDeniedException, wrapped in a blanket catch (Exception e) that only logs. The denial is reported to nobody and the next line runs.

Shape 2: a default that means success

Lookup tables and switch statements need a value for the case nobody listed. When that value is the permissive one, every new, unknown or malformed input gets it.

const STATUS = { "00": "SUCCESS", "05": "DECLINED", "51": "INSUFFICIENT_FUNDS" };

// A new gateway code, a timeout or an empty field all become a paid order
const status = STATUS[gatewayCode] ?? "SUCCESS";
// Unknown is its own state: hold the order and reconcile it
const status = STATUS[gatewayCode] ?? "UNKNOWN";
if (status !== "SUCCESS") return holdForReconciliation(order, gatewayCode);

The same applies to if status == "FAILED" ... else ..., which turns every pending and timed-out status into success, and to feature flags whose config failed to load and default to enabled. Write the default branch as a decision, not a convenience.

Shape 3: the missing input that skips the check

A verification function that throws on a missing header, wrapped in a handler that treats any exception as "fine", is CWE-234 and CWE-636 at once:

import hashlib
import hmac

def verify_webhook(headers: dict, body: bytes, secret: bytes) -> bool:
    try:
        sent = headers["X-Signature"]
        expected = hmac.new(secret, body, hashlib.sha256).hexdigest()
        return hmac.compare_digest(sent, expected)
    except Exception:
        return True  # do not drop events on a bad header

Removing the header is enough to pass. Any path through a verifier that does not end in a successful comparison must return False. The same goes for validators that start with if not value: return True. An empty input should be the easiest one to reject.

Python adds one more trap. assert user.is_admin reads like an authorization check, but the assert statement emits no code when Python runs with optimization (python -O). Use an explicit if not user.is_admin: raise PermissionDenied().

Shape 4: errors that tell the attacker too much

Unhandled errors that reach the response with their message, stack or SQL text help an attacker map the application. Express writes the stack trace to the client from its built-in handler unless NODE_ENV is production (Express error handling), and custom handlers often reintroduce the leak:

// Leaks: message, stack, sometimes the failing SQL and connection details
app.use((err, req, res, next) => {
  res.status(500).json({ error: err.message, stack: err.stack });
});
const { randomUUID } = require("node:crypto");

app.use((err, req, res, next) => {
  const id = randomUUID();
  logger.error({ err, id, path: req.path }, "unhandled error");
  res.status(500).json({ error: "Internal error", id });
});

The client gets an id it can quote to support, and the detail stays in your logs. Keep different failure messages identical where they would otherwise reveal state, such as "no such user" and "wrong password" on a login form.

Shape 5: the half-finished transaction

A transfer that debits one account, then throws before crediting the other, leaves state that an attacker can sometimes replay or race. OWASP's advice is to fail closed by rolling back every part of the transaction and starting again. In practice that means one database transaction around the whole state change, idempotency keys on retried operations, and no try block that catches the credit failure and carries on.

A review checklist for A10

  • Search for catch (Exception, except Exception, except: and catch { in authentication, authorization, payment and verification code. Each one should name the exception it expects.
  • Read every catch body in those paths. Does any of them return true, ok, 200 or a success object?
  • Check the default branch of status switches and the fallback of status lookups.
  • Check what a verifier returns when its input is missing or empty.
  • Grep Python for assert in request handlers and permission helpers.
  • Look for error objects passed straight to the response and for stack traces in production config.
  • Confirm a global error handler exists and that unhandled promise rejections are caught.

Finding A10 shapes with Vulkro

Vulkro Core maps these checks to A10:2025 and reports them in an ordinary scan:

vulkro scan . --format json > findings.json
vulkro explain generic-catch-permissive-outcome

The rules that matter most here:

Rule What it flags
generic-catch-permissive-outcome A blanket catch in a permit-style decision that returns or sets the permissive answer (Java, Apex)
generic-catch-swallows-authz-exception An authorization exception swallowed by a blanket catch (Java, Apex)
catch-returns-success-shape A JavaScript or TypeScript catch block that returns ok(), a 2xx or { success: true }
PAY-FAILOPEN-001 Payment, transfer or KYC status handling whose default, fallback or error branch is success
perm-check-call-result-discarded A permission check called with its result thrown away
python-assert-as-auth-check assert used as a runtime or authorization check in Python
empty-catch-body catch (e) {}, except: pass and Go's empty if err != nil
error-object-in-response An error object written to the response body

These are shape checks, so they report at Medium confidence: the text shows the fail-open branch, not that an attacker can reach it. The catch rules deliberately ignore the many catch (Exception e) blocks that rethrow or fail closed, because flagging every occurrence would bury the few that grant access.

FAQ

What is new in OWASP Top 10 2025 A10?

A10:2025, Mishandling of Exceptional Conditions, is a new category. It groups 24 CWEs about failing to prevent, detect or respond to unusual situations, including failing open (CWE-636), sensitive error messages (CWE-209) and missing parameters (CWE-234).

What does fail open mean in security?

A control fails open when an error in the control lets the request through, for example an authorization check that returns true when the policy service times out. Failing closed means the error results in a denial or a rollback.

Is catching Exception always a vulnerability?

No. A blanket catch that logs and rethrows, or that returns a denial, is usually fine. It becomes a vulnerability when the catch sits around a security decision and turns the failure into a permit, or swallows the denial itself.

See the API security use case and the taint analysis docs, or start a 14-day trial. Related: broken access control is still number one and the sign-in that never checks the signature.