When an application hits a condition its developers did not plan for, it often does something insecure: it leaks internals, fails open, leaves a transaction half done or falls over. A10:2025 Mishandling of Exceptional Conditions is the new OWASP Top 10 category for these failures, and it collects 24 CWEs that earlier editions scattered under code quality. This guide explains what OWASP includes, how ASVS 5.0 turns it into testable requirements, where authentication and machine credential handling fail under error, and how to implement, test and evidence a fail-secure error model. It goes deeper than the OWASP Top 10 Guide and is written for developers, application security engineers and architects who review error paths.
Key takeaways
- A new category for 2025. OWASP added A10 to replace broad code quality CWEs with a focused set of 24 covering how software prevents, detects and responds to unusual conditions.
- Three ways to fail. OWASP says an application mishandles an exceptional condition when it does not prevent it, does not recognise it as it happens, or responds poorly or not at all afterwards.
- Fail closed is the rule. CWE-636 Not Failing Securely ('Failing Open') and ASVS V16.5.3 require that an error in a security check denies the action rather than allowing it.
- Error messages are reconnaissance. Stack traces, SQL errors and framework versions returned to clients (CWE-209, CWE-550) help attackers refine injection and target known flaws.
- Handle locally, catch globally. OWASP asks for errors to be handled where they occur, with a global "last resort" handler (ASVS V16.5.4) as the safety net, and one consistent mechanism across the organisation.
What it is and who it applies to
OWASP defines the category as software failing to prevent, detect or respond to unusual and unpredictable situations, leading to crashes, unexpected behaviour and vulnerabilities. Its listed causes are missing or incomplete input validation, error handling that happens late and at a high level instead of at the point of failure, unexpected environmental states such as memory, privilege or network problems, inconsistent exception handling and unhandled exceptions. OWASP's own shorthand: any time an application is unsure of its next step, an exceptional condition has been mishandled.
The consequences reach all three security properties: logic bugs, overflows, race conditions, fraudulent transactions and failures in memory, state, resources, timing, authentication and authorisation. The category therefore applies to every team writing server-side code, APIs, background workers and integrations, and to security engineers who design authentication and authorisation libraries, because those are the components where failing open is most damaging.
| Data point (OWASP Top 10:2025) | A10 value |
|---|---|
| CWEs mapped | 24 |
| Max / average incidence rate | 20.67% / 2.95% |
| Max / average coverage | 100.00% / 37.95% |
| Average weighted exploit / impact | 7.11 / 3.81 |
| Total occurrences | 769,581 |
| Total CVEs | 3,416 |
Structure and key requirements
The 24 CWEs fall into four practical groups. Grouping them helps decide which tool or review technique finds each one.
| Group | CWEs (OWASP A10:2025 mapping) | Typical symptom | Best found by |
|---|---|---|---|
| Information exposure through errors | CWE-209, CWE-215, CWE-550, CWE-756 | Stack trace, SQL error or debug data in a response; no custom error page | DAST, manual testing, configuration review |
| Unchecked or ignored errors | CWE-252, CWE-390, CWE-391, CWE-394, CWE-754, CWE-703, CWE-755 | Return value or status ignored; error detected but no action taken | SAST, code review |
| Poor exception design and cleanup | CWE-248, CWE-396, CWE-397, CWE-460, CWE-476, CWE-369, CWE-478, CWE-484 | Uncaught exception, catch-all that swallows errors, resources not released, null dereference, missing default case | SAST, fuzzing, stress testing |
| Unsafe failure state and parameter handling | CWE-636, CWE-274, CWE-280, CWE-234, CWE-235 | Security check fails open; missing or extra parameter changes behaviour; insufficient privilege not handled | Code review, negative testing, threat modelling |
What OWASP asks you to do
- Plan for failure: assume things will go wrong, and handle errors where they occur with a meaningful recovery: an understandable error to the user, a log entry and an alert when justified.
- Global handler as safety net: catch anything missed in one place, log it and return a generic response.
- Fail closed on transactions: roll back failed transactions completely and restart, because partial recovery often causes unrecoverable errors.
- Apply limits: rate limits, resource quotas and throttling, because unlimited resources lead to denial of service, brute-force success and high cloud costs. See the Rate Limiting and API Abuse Guide.
- Summarise repeated errors: above a set rate, report identical errors as statistics so logging and monitoring keep working.
- Validate strictly and centralise: strict input validation and one consistent error handling, logging, monitoring and alerting mechanism per application, ideally organisation wide.
- Build it into the lifecycle: security requirements, threat modelling, secure design review, code review or static analysis, and stress, performance and penetration testing.
ASVS 5.0 V16.5 Error Handling
| Requirement | Level | What it requires (summarised) |
|---|---|---|
| V16.5.1 | 2 | A generic message to the consumer on unexpected or security-sensitive errors, with no stack traces, queries, secret keys or tokens |
| V16.5.2 | 2 | Continue to operate securely when external resources fail, for example with circuit breakers or graceful degradation |
| V16.5.3 | 2 | Fail gracefully and securely, preventing fail-open conditions such as processing a transaction despite validation errors |
| V16.5.4 | 3 | A "last resort" handler that catches all unhandled exceptions, so details reach the logs and one error does not take down the process |
For API responses, the OWASP Error Handling Cheat Sheet recommends a consistent problem document. RFC 9457 Problem Details for HTTP APIs (which obsoletes RFC 7807) defines the application/problem+json media type with type, status, title, detail and instance members, and its security considerations warn against exposing implementation internals such as stack dumps.
Identity and NHI requirements
Authentication and authorisation code is where exceptional conditions do the most harm, because the safe answer to "I am not sure" is always "deny". The same applies to code that fetches or uses machine credentials.
| Exceptional condition | Fail-open behaviour to avoid | Fail-secure behaviour |
|---|---|---|
| Token validation library throws (bad signature format, unknown key ID, clock error) | Exception caught generically and request continues as anonymous or with cached claims | Reject with 401, log the validation failure with key ID and issuer |
| Policy engine or authorisation service unreachable | Default to allow to keep the service available | Deny, or a documented degraded mode limited to read-only non-sensitive actions |
| JWKS or certificate revocation endpoint times out | Skip the check | Use a cached key set with a bounded lifetime, otherwise reject |
| Secrets manager unavailable at start-up | Fall back to a hard-coded or default credential | Fail to start and alert; never ship a fallback secret |
| Missing or extra parameter on an API call (CWE-234, CWE-235) | Missing tenant or scope parameter treated as "all" | Reject the request with a 400 problem document |
| Insufficient privilege for an internal operation (CWE-274, CWE-280) | Retry with a more privileged service account | Stop, log and surface the error to the owner |
- Never echo credentials in errors: ASVS V16.5.1 names secret keys and tokens explicitly. Connection failures that print the full connection string, and HTTP client exceptions that include the Authorization header, are common sources. See the OWASP NHI Top 10 NHI2 Secret Leakage Guide.
- No privilege escalation on retry: a workload that catches an access denied error and retries with a broader identity turns an exception into a privilege escalation path. See the OWASP NHI Top 10 NHI5 Overprivileged NHI Guide.
- Distinguish client and server errors: the cheat sheet recommends 4xx for client-caused problems such as unauthorised access and 5xx only for failures the server cannot handle, with 5xx rates monitored. A spike in 5xx from token validation is a detection signal, not just an availability issue. See the OWASP Top 10 A09 Guide.
Implementation steps
- Set the error model: write a short standard covering exception types, which layer handles what, the generic client response (problem document format), the log event for each error class and the rule that security checks fail closed.
- Install the global handler first: configure the framework's last resort handler so no stack trace can reach a client. Examples from the OWASP cheat sheet: an
<error-page>forjava.lang.Exceptioninweb.xml; a@RestControllerAdviceclass returningProblemDetailin Spring;UseExceptionHandlerwithUseDeveloperExceptionPageonly in development for ASP.NET Core;customErrors mode="RemoteOnly"for ASP.NET on .NET Framework. Test in a staging environment by forcing an exception, then promote. - Audit security-critical paths: review every catch block in authentication, authorisation, payment and data export code. Look for catch-all handlers (CWE-396), empty catches (CWE-390), ignored return values (CWE-252) and default branches that allow (CWE-478, CWE-636).
- Make transactions atomic: wrap multi-step state changes in a transaction or a saga with compensating actions, so a failure mid-way rolls back fully. Add idempotency keys to prevent duplicate execution after retries.
- Add limits and resilience patterns: timeouts on every outbound call, circuit breakers for dependencies (ASVS V16.5.2), resource quotas, and release of file handles, connections and locks in
finallyor equivalent constructs (CWE-460). - Enable static rules in CI: turn on SAST rules for the A10 CWEs in audit mode first, review the findings, then make new high-severity findings block merges. See the Secure Code Review Guide.
- Test the unhappy path: fuzz parsers and API inputs, run negative tests with missing, extra and malformed parameters, inject dependency failures (timeouts, refused connections, expired certificates) and stress test resource limits. See the Fuzzing Guide.
- Roll out in stages: change error handling behind feature flags or deployment rings and watch error rates and support tickets. Roll back by reverting the flag, never by re-enabling detailed errors in production.
Small versus large organisations: a small team gets most of the value from a framework global handler, a problem details response and a code review checklist. A larger organisation should provide a shared error handling library per language, SAST rules tuned to it, and a resilience testing programme that includes dependency failure injection.
The July 2024 CrowdStrike Channel File 291 incident is a widely studied example of an unanticipated condition: CrowdStrike's root cause analysis describes a definition expecting 21 input fields while the sensor supplied 20, and a content interpreter with no runtime bounds check, so the resulting out-of-bounds read crashed Windows hosts. Its fixes were the A10 list in practice: compile-time and runtime validation, tests that exercised every field and staged deployment with rollback. See the Third-Party Concentration Risk Guide.
Evidence and assessment
| Evidence | How to test | Pass indicator |
|---|---|---|
| Error handling standard | Document review | Fail-closed rule, response format and log events defined |
| Global handler configuration | Force an unhandled exception in staging; inspect response | Generic message, correct status, no stack trace or versions (ASVS V16.5.1, V16.5.4) |
| Fail-closed security checks | Make the authorisation service or JWKS endpoint unavailable in a test environment | Requests denied; failure logged and alerted |
| Transaction integrity | Interrupt a multi-step operation between steps | Full rollback; no duplicate or partial effect |
| Static analysis results | SAST report filtered to the A10 CWEs | No open high-severity findings on critical paths; exceptions recorded |
| Fuzz and stress results | Fuzzing campaign and load test reports | No crashes, hangs or resource leaks left unresolved |
Metrics that show it is working
- Unhandled exception rate: exceptions reaching the global handler per million requests, trending down as local handling improves.
- Error disclosure findings: DAST or penetration test findings for verbose errors (CWE-209, CWE-550) per release.
- Open A10 SAST findings: count and age of findings mapped to the 24 CWEs on critical services.
- Fail-closed test pass rate: share of security dependencies with an automated test proving they deny on failure.
- 5xx ratio by endpoint: server error rates, with alerts on sudden rises that may indicate probing.
Mapping to other frameworks
| Framework | Reference | Relevance to A10 |
|---|---|---|
| NIST SP 800-53 Rev. 5 | SI-11 Error Handling | Error messages that do not reveal exploitable information, shown only to authorised personnel |
| NIST SP 800-53 Rev. 5 | SC-24 Fail in Known State, SI-17 Fail-safe Procedures | Fail closed and preserve state on failure |
| NIST SP 800-53 Rev. 5 | SA-11 Developer Testing and Evaluation | Static analysis, fuzzing and negative testing |
| CIS Controls v8.1 | Control 16 Application Software Security | Secure development practices (mapped at control level) |
| ISO/IEC 27001:2022 Annex A | A.8.28 Secure coding, A.8.29 Security testing in development and acceptance | Coding standards and testing of error paths |
| MITRE ATT&CK v20 | T1190 Exploit Public-Facing Application, T1499.004 Application or System Exploitation | Exploiting error paths for access or to crash services |
| MITRE CAPEC | CAPEC-54 Query System for Information, CAPEC-215 Fuzzing for application mapping | Using forced errors to gather information |
| OWASP ASVS 5.0 | V16.5.1 to V16.5.4 | Verifiable error handling requirements |
Common pitfalls
- Catch everything, do nothing:
catch (Exception e) {}in an authorisation helper turns every failure into a pass. CWE-390 and CWE-396 are the usual SAST hits. - Developer error pages in production: framework debug pages left on after a deployment expose stack traces, paths and versions. Tie debug mode to an environment variable that production cannot set.
- Availability over security in auth: teams under outage pressure add "allow if the policy service is down" logic and never remove it.
- Partial transactions: a debit committed before a credit fails, with no compensation, is the OWASP financial state corruption scenario and a race condition target.
- Resource leaks on exception paths: OWASP's upload example: exceptions are caught but locks and handles are never released, until the service stops.
- Testing only the happy path: as the CrowdStrike root cause analysis showed, tests that never exercise an unusual input value miss the fault that later matters.
Practitioner checklist
- Publish an error handling standard with a fail-closed rule for every security check.
- Configure a global last resort handler in every application and verify no stack traces reach clients.
- Return RFC 9457 problem documents with generic detail for unexpected errors.
- Review all catch blocks in authentication, authorisation, payment and export code.
- Make multi-step state changes atomic, with rollback or compensation and idempotency keys.
- Set timeouts, circuit breakers and quotas on every external dependency.
- Ensure credential retrieval failures stop the workload rather than fall back to a default secret.
- Enable SAST rules for the A10 CWEs and gate new high-severity findings.
- Fuzz inputs and inject dependency failures in CI or pre-release testing.
- Log and alert on unhandled exceptions and 5xx spikes.
Standards and references
- OWASP: A10:2025 Mishandling of Exceptional Conditions
- OWASP: Application Security Verification Standard 5.0
- OWASP: Error Handling Cheat Sheet
- IETF: RFC 9457 Problem Details for HTTP APIs
- MITRE: CWE-636 Not Failing Securely ('Failing Open')
- NIST: SP 800-53 Rev. 5
- CrowdStrike: Channel File 291 Incident Root Cause Analysis
Related NHI Mgmt Group resources: OWASP Top 10 Guide · OWASP Top 10 A09 Guide · Secure Error Handling and Logging Guide · Secure Code Review Guide · Fuzzing Guide