<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Nef — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/nef/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 02 Jan 2024 18:30:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/nef/feed.xml" rel="self" type="application/rss+xml"/><item><title>free5GC NEF Denial-of-Service via Unreachable notifyUri</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-free5gc-nef-dos/</link><pubDate>Tue, 02 Jan 2024 18:30:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-02-free5gc-nef-dos/</guid><description>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.</description><content:encoded><![CDATA[<p>free5GC&rsquo;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 <code>notifyUri</code>. When a PFD change event occurs, the NEF attempts to send an HTTP POST request to the configured <code>notifyUri</code>. 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 <code>/3gpp-traffic-influence/v1/afdos/subscriptions</code>, <code>/nnef-pfdmanagement/v1/subscriptions</code>, and <code>/3gpp-pfd-management/v1/afdos/transactions</code>, reachable without authentication due to misconfiguration of SBI route groups.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker sends an HTTP POST request to <code>/3gpp-traffic-influence/v1/afdos/subscriptions</code> to create an AF context with <code>afAppId</code> set to &ldquo;app-nef-dos&rdquo; and <code>anyUeInd</code> to true.</li>
<li>The NEF creates a new AF context subscription and returns a <code>201 Created</code> response with the <code>Location</code> header indicating the new subscription URI.</li>
<li>The attacker sends an HTTP POST request to <code>/nnef-pfdmanagement/v1/subscriptions</code> to create a PFD subscription, including a malicious <code>notifyUri</code> such as <code>http://127.0.0.1:1/notify</code>.</li>
<li>The NEF stores the PFD subscription with the attacker-controlled <code>notifyUri</code>.</li>
<li>The attacker sends an HTTP POST request to <code>/3gpp-pfd-management/v1/afdos/transactions</code> to trigger a PFD change.</li>
<li>The NEF processes the PFD change request and returns a <code>201 Created</code> response.</li>
<li>The NEF attempts to deliver an asynchronous notification to the attacker-specified <code>notifyUri</code> via an HTTP POST request.</li>
<li>Because the <code>notifyUri</code> is unreachable (e.g., port 1 is closed), the outbound HTTP POST fails, triggering the <code>logger.Fatal(err)</code> call and terminating the NEF process with exit code 1.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>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&rsquo;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.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the upstream fix available at <a href="https://github.com/free5gc/nef/pull/25">https://github.com/free5gc/nef/pull/25</a> to prevent the <code>logger.Fatal</code> call on notification delivery failure.</li>
<li>Deploy the Sigma rule &ldquo;Detect NEF PFD Subscription with Unreachable notifyUri&rdquo; to detect attempts to create subscriptions with suspicious callback URLs.</li>
<li>Monitor NEF container logs for <code>[FATA][NEF][PFDMng]</code> messages, which indicate that the NEF process has terminated due to the vulnerability, as shown in the container log example.</li>
<li>Review and harden the authentication configuration for NEF SBI route groups to prevent unauthenticated access, as discussed in <a href="https://github.com/free5gc/free5gc/issues/858">free5gc/free5gc#858</a>, <a href="https://github.com/free5gc/free5gc/issues/859">free5gc/free5gc#859</a>, and <a href="https://github.com/free5gc/free5gc/issues/862">free5gc/free5gc#862</a>.</li>
<li>Audit all code paths that use <code>logger.Fatal</code> and replace them with recoverable error handling.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>dos</category><category>vulnerability</category><category>free5gc</category></item></channel></rss>