CWEweakness
CWE-484 Omitted Break Statement in Switch
Medium
Official page ↗
- Abstraction
- Base
- Structure
- Simple
- Status
- Draft
- Likelihood of exploit
- Medium
- Languages
- C, C#, C++, Java, Not Language-Specific, PHP
- CWE version
- 5.0
Description
The product omits a break statement within a switch or similar construct, causing code associated with multiple conditions to execute. This can cause problems when the programmer only intended to execute code associated with one condition.
Common consequences
• Other: Alter Execution Logic — This weakness can cause unintended logic to be executed and other unexpected application behavior. It can lead to critical code executing in situations where it should not.
Potential mitigations
• [Implementation] Omitting a break statement so that one may fall through is often indistinguishable from an error, and therefore should be avoided. If you need to use fall-through capabilities, make sure that you have clearly documented this within the switch statement, and ensure that you have examined all the logical possibilities.
• [Implementation] The functionality of omitting a break statement could be clarified with an if statement. This method is much safer.
Detection methods
• White Box: Omission of a break statement might be intentional, in order to support fallthrough. Automated detection methods might therefore be erroneous. Semantic understanding of expected product behavior is required to interpret whether the code is correct.
• Black Box: Since this weakness is associated with a code construct, it would be indistinguishable from other errors that produce the same behavior.
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Related
Child of · CWE (2)
Referenced by CVE · weakness (1)
- CVE-2026-44075 A missing break statement in DSI OpenSession processing in Netatalk 1.5.0 through 4.4.2 causes a DSIOPT_ATTNQUANT switch case to fall… vulnerability
Referenced by CWE · has member (1)
- CWE-884 CWE Cross-section view
Referenced by OWASP · mapped cwe (1)
- A10:2025 Mishandling of Exceptional Conditions Top 10 2025