The vulnerability lies in the improper validation of UE (User Equipment) context ownership within multiple NGAP (Next Generation Application Protocol) message handlers in Ella Core's AMF (Access and Mobility Management Function). The core issue was that when processing certain NGAP messages, the system would look up the UE context using an identifier (AMF-UE-NGAP-ID) provided by a radio, but it failed to verify that the identified UE was actually associated with the specific radio that sent the message. The lookup was performed in a global scope across all connected radios.
An attacker with control of a valid, connected radio could exploit this by sending a forged NGAP message, such as PDUSessionResourceSetupResponse, containing the AMF-UE-NGAP-ID of a victim UE. The AMF would find the victim's UE context and incorrectly associate it with the attacker's radio, effectively hijacking the UE's data session. This would cause all subsequent downlink traffic intended for the victim to be redirected to the attacker's radio.
The patch addresses this by changing the UE lookup mechanism. Instead of performing a global search, the updated code scopes the search to the specific radio instance that received the NGAP message. This is achieved by introducing a new resolveUE function and modifying existing handlers to use radio-specific lookup methods (e.g., ran.FindUEByAmfUeNgapID instead of amfInstance.FindRanUeByAmfUeNgapID). This ensures that a radio can only manipulate UE contexts that are legitimately under its control, preventing the cross-radio session hijacking attack.