The analysis began by examining the provided vulnerability information, which indicated a security capability bypass in the NGAP PathSwitchRequest handler. The first step was to identify the relevant code changes by comparing the vulnerable and patched versions of the ellanetworks/core repository. By analyzing the commits between the last vulnerable version and the first patched version, I was able to pinpoint the exact functions that were modified to address the security issue.
The primary vulnerable function identified is HandlePathSwitchRequest. The evidence from the patch shows that a new verification step was added to this function to compare the UE security capabilities received in the PathSwitchRequest with the locally stored values. The absence of this check in the vulnerable version is the root cause of the vulnerability described in the advisory.
Additionally, the analysis of the commits revealed a second, related vulnerability in the AmfUe.SelectSecurityAlg function. This function was found to default to null security algorithms if the UE's security capabilities were not available. This represents a significant security risk, as it could lead to unencrypted and unauthenticated communication. Although not the primary focus of the advisory, this function was also patched in the same release and is included in the analysis as a relevant security finding.
Both of these functions would appear in a runtime profile during the exploitation of these vulnerabilities, making them key indicators for detection and a priority for patching.