free5GC NEF Denial-of-Service via Unreachable notifyUri
free5GC's NEF component is vulnerable to a denial-of-service attack where an attacker can create a PFD subscription with an attacker-controlled `notifyUri`, and when a PFD change is triggered, NEF attempts to deliver a notification to the specified URI, and if the URI is unreachable, NEF terminates the entire process, causing a service outage, and this can be triggered without authentication in version 4.2.1, making it easily exploitable.
free5GC’s Network Exposure Function (NEF) is susceptible to a denial-of-service vulnerability. An attacker with the ability to create a PFD subscription can specify an arbitrary notifyUri. When a PFD change event occurs, the NEF attempts to send an HTTP POST request to the configured notifyUri. If this notification delivery fails (e.g., due to connection refused, DNS resolution failure, or timeout), the NEF process terminates due to an unhandled error condition. This behavior, present in version 4.2.1, allows an unauthenticated attacker to remotely trigger a complete NEF service outage. The vulnerability is triggered by posting to /3gpp-traffic-influence/v1/afdos/subscriptions, /nnef-pfdmanagement/v1/subscriptions, and /3gpp-pfd-management/v1/afdos/transactions, reachable without authentication due to misconfiguration of SBI route groups.
Attack Chain
- The attacker sends an HTTP POST request to
/3gpp-traffic-influence/v1/afdos/subscriptionsto create an AF context withafAppIdset to “app-nef-dos” andanyUeIndto true. - The NEF creates a new AF context subscription and returns a
201 Createdresponse with theLocationheader indicating the new subscription URI. - The attacker sends an HTTP POST request to
/nnef-pfdmanagement/v1/subscriptionsto create a PFD subscription, including a maliciousnotifyUrisuch ashttp://127.0.0.1:1/notify. - The NEF stores the PFD subscription with the attacker-controlled
notifyUri. - The attacker sends an HTTP POST request to
/3gpp-pfd-management/v1/afdos/transactionsto trigger a PFD change. - The NEF processes the PFD change request and returns a
201 Createdresponse. - The NEF attempts to deliver an asynchronous notification to the attacker-specified
notifyUrivia an HTTP POST request. - Because the
notifyUriis unreachable (e.g., port 1 is closed), the outbound HTTP POST fails, triggering thelogger.Fatal(err)call and terminating the NEF process with exit code 1.
Impact
The vulnerability leads to a complete denial-of-service condition for the free5GC NEF. Successful exploitation results in the NEF process terminating abruptly, causing loss of service and requiring a restart. Since the trigger chain is unauthenticated in v4.2.1, any attacker capable of reaching the NEF’s SBI interface can remotely trigger the process termination. This can be repeated to sustain the outage indefinitely, severely impacting the availability of the 5G network services reliant on the NEF. The vulnerability affects free5GC v4.2.1.
Recommendation
- Apply the upstream fix available at https://github.com/free5gc/nef/pull/25 to prevent the
logger.Fatalcall on notification delivery failure. - Deploy the Sigma rule “Detect NEF PFD Subscription with Unreachable notifyUri” to detect attempts to create subscriptions with suspicious callback URLs.
- Monitor NEF container logs for
[FATA][NEF][PFDMng]messages, which indicate that the NEF process has terminated due to the vulnerability, as shown in the container log example. - Review and harden the authentication configuration for NEF SBI route groups to prevent unauthenticated access, as discussed in free5gc/free5gc#858, free5gc/free5gc#859, and free5gc/free5gc#862.
- Audit all code paths that use
logger.Fataland replace them with recoverable error handling.
Detection coverage 2
Detect NEF PFD Subscription with Unreachable notifyUri
mediumDetects PFD subscription creation with a notifyUri pointing to a likely unreachable IP address and port
Detect NEF PFD Management Transactions
lowDetects POST requests to the /3gpp-pfd-management/v1/afdos/transactions endpoint, potentially indicating an attempt to trigger the PFD change vulnerability.
Detection queries are available on the platform. Get full rules →
Indicators of compromise
1
url
| Type | Value |
|---|---|
| url | http://127.0.0.1:1/notify |