Umbra Wiki weakness weakness/CWE-391
Back to wiki

CWE-391 — Unchecked Error Condition

provenance: imported · CWE: CWE-391

CWE-391: Unchecked Error Condition

MITRE CWE weakness

Kind Weakness
Abstraction Base
Status Incomplete
Likelihood of exploit Medium

Description

[PLANNED FOR DEPRECATION. SEE MAINTENANCE NOTES AND CONSIDER CWE-252, CWE-248, OR CWE-1069.] Ignoring exceptions and other error conditions may allow an attacker to induce unexpected behavior unnoticed.

Common consequences

  • Integrity, Other: Varies by Context, Unexpected State, Alter Execution Logic

Mitigations

Requirements — The choice between a language which has named or unnamed exceptions needs to be done. While unnamed exceptions exacerbate the chance of not properly dealing with an exception, named exceptions suffer from the up call version of the weak base class problem.

Requirements — A language can be used which requires, at compile time, to catch all serious exceptions. However, one must make sure to use the most current version of the API as new exceptions could be added.

Implementation — Catch all relevant exceptions. This is the recommended solution. Ensure that all exceptions are handled in such a way that you can be sure of the state of your system at any given moment.

References

  • CWE page: https://cwe.mitre.org/data/definitions/391.html
  • CWE list: https://cwe.mitre.org/data/index.html