Skip to content
OpenAdvisories

Weakness (CWE)

CWE-478: Missing Default Case in Multiple Condition Expression

Base Draft

The code does not have a default case in an expression with multiple conditions, such as a switch statement.

How to prevent it (1 mitigation)
  1. Implementation

    Ensure that there are no cases unaccounted for when adjusting program flow or values based on the value of a given variable. In the case of switch style statements, the very simple act of creating a default case can, if done correctly, mitigate this situation. Often however, the default case is used simply to represent an assumed option, as opposed to working as a check for invalid input. This is poor practice and in some cases is as bad as omitting a default case entirely.

Source: MITRE CWE-478

1 result · Feed

  • High 8.7

    free5GC UDM DataChangeNotification Procedure Panic Due to Nil Pointer Dereference

    Free5GC is an open-source Linux Foundation project for 5th generation (5G) mobile core networks. Versions prior to 1.4.2 are vulnerable to procedure panic caused by Nil Pointer Dereference in the /sdm-subscriptions endpoint. A remote attacker can cause the UD…