Summary
Open5GS versions up to 2.7.6 contain an improper authentication issue in the NGAP PathSwitchRequest message handler, allowing certain signaling operations to bypass intended verification.
A remote attacker who can send crafted NGAP messages over the control plane may exploit this flaw to interfere with session handling or mobility procedures in a 5G core deployment.
Affected context
This vulnerability appears in Open5GS's Access and Mobility Management Function (AMF), specifically within the NGAP PathSwitchRequest message handling logic in src/amf/ngap-handler.c.
It is relevant in environments where:
- Open5GS AMF is deployed and reachable over the NGAP interface
- gNBs or test tools can initiate PathSwitchRequest signaling towards the AMF
- The deployment relies on NGAP-level checks for validating and authorizing mobility or path switch procedures
The weakness stems from insufficient authentication or verification of signaling context when processing PathSwitchRequest messages.
Exploit preconditions
- Attack surface: NGAP control plane interface exposed by the AMF (typically between gNB and AMF).
- Required access: Ability to send or relay NGAP PathSwitchRequest messages to the AMF (e.g., as a connected or spoofed gNB, or via a testing/emulation tool on the control plane).
- Trigger point: Processing of a crafted PathSwitchRequest message by the NGAP PathSwitchRequest handler in
ngap-handler.c. - Why exploitation is possible: The handler performs incomplete or improper authentication/authorization of the signaling context, allowing messages that lack proper validation of origin, association, or session state to be accepted and processed.
Why this happens
The underlying issue maps to CWE-287: Improper Authentication, where the system fails to correctly verify that an entity is who it claims to be before allowing sensitive operations.
In the NGAP PathSwitchRequest handler, the logic likely assumes that messages received on the NGAP interface are already trustworthy or sufficiently checked, and therefore does not perform robust verification of the signaling context, identifiers, or session ownership.
This design flaw results in trust being placed in messages that may come from unauthorized or improperly authenticated sources, enabling unauthorized manipulation of mobility or session state in the AMF.
Potential impact
- Unauthorized initiation or manipulation of path switch or mobility procedures in the 5G core.
- Disruption or hijacking of subscriber sessions through unauthorized signaling changes.
- Potential denial of service conditions if malicious PathSwitchRequest messages trigger inconsistent or invalid state transitions.
- Undermining of trust boundaries between the RAN and core network, potentially aiding larger attack chains on signaling infrastructure.
General mitigation guidance
Mitigation is generally achieved by strengthening authentication and authorization around NGAP signaling and limiting trust in external inputs:
- Enforce strict identity verification for NGAP peers, ensuring that only authenticated and authorized gNBs or test systems can send PathSwitchRequest messages.
- Validate signaling context rigorously: tie each PathSwitchRequest to an established and verified session, and reject messages with inconsistent or unexpected identifiers.
- Apply defense-in-depth on the control plane by segregating and monitoring signaling networks, reducing the chance of untrusted entities accessing the NGAP interface.
- Implement least-privilege design for signaling operations so that even authenticated peers can only perform actions justified by current session state and policy.
- Adopt secure-by-default configurations that treat all external signaling as untrusted until fully validated.
How teams detect issues like this
Organizations can look for improper authentication issues in signaling handlers using several approaches:
- Static analysis: Flag code paths where critical signaling messages (like PathSwitchRequest) are processed without preceding checks on peer identity, session state, or authorization.
- Code review: Pay special attention to AMF control-plane handlers, verifying that each handler enforces clear preconditions before mutating session or mobility state.
- Runtime monitoring: Instrument logging for NGAP operations to detect anomalous or unexpected PathSwitchRequest patterns, such as frequent requests from unusual peers or out-of-sequence state transitions.
- Policy enforcement: Use configuration management and network policy tools to ensure NGAP interfaces are only reachable from defined, authenticated RAN nodes and follow strict onboarding and certificate verification procedures.

