# A10:2025 - Mishandling of Exceptional Conditions

> Weaknesses in how applications manage and recover from errors or unexpected states.

- **Category**: Owasp Security
- **Subcategory**: top10_2025
- **Canonical URL**: https://designpattern.fyi/owasp_security/a10_exceptional_conditions/

---

## Description
'**Intent**: Handle errors and exceptional conditions gracefully without exposing sensitive information or creating security vulnerabilities.

**Context**: Applications that improperly handle errors may leak stack traces, database queries, or other sensitive information. Poor error handling can also leave systems in an insecure state or cause denial of service.

**Solution**: Implement consistent error handling across the application. Never expose stack traces or internal details to users. Use generic error messages. Ensure the application fails securely. Test error handling paths thoroughly.'



## Use Cases
Use when designing error handling strategies, implementing exception handling, or building resilient systems.





## Trade-offs


### Advantages

- Prevents information leakage

- Ensures fail-secure behavior

- Improves application resilience

- Reduces attack surface




### Considerations & Drawbacks

- Generic errors make debugging harder

- Comprehensive error handling adds code complexity

- Testing all error paths is challenging







---
**Reference**: [Original Source](https://owasp.org/Top10/2025)

