free5GC NEF Unauthenticated Callback Vulnerability
free5GC NEF v4.2.1 exposes an unauthenticated callback route group, enabling attackers to forge SMF callbacks and potentially corrupt AF traffic-influence or PFD-management subscription views, leading to unauthorized policy changes.
The free5GC NEF (Network Exposure Function) version 4.2.1 contains a critical vulnerability stemming from the lack of inbound authentication on the nnef-callback route group. This oversight allows an attacker to send forged SMF (Service Management Function) callback requests to the NEF without proper authorization. The vulnerability lies in the fact that the API layer processes the request body and deserializes it before any authentication check is performed. This can lead to corruption of AF (Application Function) traffic-influence or PFD (Packet Flow Description) management subscription views and influence downstream SMF/UPF (User Plane Function) policy decisions. The nnef-callback route group remains reachable even when the runtime ServiceList does not declare it, undermining intended service disabling mechanisms.
Attack Chain
- Attacker identifies a reachable NEF instance running free5GC v4.2.1.
- Attacker crafts a malicious SMF callback request targeting the
/nnef-callback/v1/notification/smfendpoint. - The attacker sets the
Authorizationheader with a forged or arbitrary bearer token (e.g.,Authorization: Bearer not-a-real-token). - The NEF server receives the request and, due to the missing authentication middleware, parses the request body without validating the token.
- The callback handler within the NEF processes the request and attempts to look up subscription state using the provided
NotifId. - If the
NotifIdis valid, the attacker can manipulate subscription data, leading to traffic-influence or PFD-management corruption. - The corrupted subscription data influences downstream SMF/UPF policy decisions, potentially diverting traffic or modifying service quality.
- Attacker gains unauthorized control over network traffic and subscriber experience.
Impact
The lack of authentication on the nnef-callback route group allows any party that can reach the NEF on the SBI (Service Based Interface) to submit forged SMF callbacks anonymously. An attacker who can guess or obtain a valid NotifId can deliver forged event notifications against real subscription state, corrupting AF traffic-influence and PFD-management subscription views, and subsequently influencing downstream SMF/UPF policy decisions. The vulnerability can lead to unauthorized traffic diversion, service disruption, or modification of service quality for subscribers. The affected version is free5GC v4.2.1, potentially impacting deployments of this version in various telecommunications networks.
Recommendation
- Deploy the Sigma rule
Detect Unauthenticated NEF Callback Requestto identify attempts to exploit the vulnerability by detecting requests to the/nnef-callback/v1/notification/smfendpoint with invalid or suspicious authorization headers (see rule below). - Monitor web server logs for unauthorized POST requests to the
/nnef-callback/v1/notification/smfendpoint, referencing the IP address10.100.200.19from the provided PoC. - Upgrade to a patched version of free5GC NEF that addresses the authentication vulnerability (see upstream fix at https://github.com/free5gc/nef/pull/24).
- Apply input validation and authorization checks on all SBI endpoints, especially callback handlers, to prevent unauthorized access and data manipulation.
- Review and harden the NEF configuration to ensure that only authorized services and endpoints are exposed, mitigating the risk of unauthorized access.
Detection coverage 2
Detect Unauthenticated NEF Callback Request
highDetects attempts to exploit the unauthenticated NEF callback vulnerability by identifying requests with invalid or suspicious authorization headers.
Detect NEF Callback with Empty Authorization Header
highDetects NEF callback requests to the /nnef-callback endpoint with an empty or missing Authorization header, indicating a potential exploit attempt.
Detection queries are available on the platform. Get full rules →