CAS-003 · Question #324
Given the following code snippet: Which of the following failure modes would the code exhibit?
The correct answer is D. Exception. The code snippet (not visible in this question) exhibits an exception failure mode, meaning it throws an unhandled runtime exception rather than failing in a controlled, intentional manner.
Question
Given the following code snippet:
Which of the following failure modes would the code exhibit?
Exhibit
Options
- AOpen
- BSecure
- CHalt
- DException
How the community answered
(24 responses)- A8% (2)
- B13% (3)
- C4% (1)
- D75% (18)
Why each option
The code snippet (not visible in this question) exhibits an exception failure mode, meaning it throws an unhandled runtime exception rather than failing in a controlled, intentional manner.
Fail-open is an intentional design pattern where the system grants access or continues operation when an error occurs, requiring explicit conditional logic to detect the error and allow passage - not an unhandled exception.
Fail-secure (fail-closed) is an intentional design pattern where the system denies access or locks down when an error is detected, indicating deliberate defensive error handling was implemented in the code.
A halt failure mode means execution terminates cleanly and explicitly, which requires intentional handling logic such as a system exit call; an unhandled exception typically produces an error trace rather than a controlled clean halt.
An exception failure mode occurs when code encounters an unexpected error condition - such as a null reference, out-of-bounds access, or type mismatch - without a surrounding try/catch or error handling block, causing the runtime to throw an unhandled exception instead of gracefully transitioning to a defined safe or failed state.
Concept tested: Application failure modes and unhandled exception behavior
Source: https://owasp.org/www-community/Fail_securely
Topics
Community Discussion
No community discussion yet for this question.
