<?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>Free5GC SMF — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/free5gc-smf/</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 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/free5gc-smf/feed.xml" rel="self" type="application/rss+xml"/><item><title>free5GC SMF Unauthenticated State-Mutating Panic-DoS Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-free5gc-smf-dos/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-02-free5gc-smf-dos/</guid><description>free5GC's SMF is vulnerable to an unauthenticated denial-of-service attack where a crafted DELETE request to the /upi/v1/upNodesLinks/{ref} endpoint triggers a nil-pointer dereference, causing a panic and mutating the in-memory user-plane topology, impacting the selection of UPFs for legitimate UE sessions.</description><content:encoded><![CDATA[<p>free5GC&rsquo;s SMF (Session Management Function) contains a vulnerability where the <code>UPI</code> (User Plane Interface) management route group lacks proper authentication, exposing it to unauthenticated attacks. Specifically, the <code>DELETE /upi/v1/upNodesLinks/{upNodeRef}</code> handler attempts to dereference a potentially nil <code>UPF</code> (User Plane Function) pointer, leading to a nil-pointer dereference and panic. This occurs because <code>AN</code>-typed (Access Node) nodes are constructed without a <code>UPF</code> object. An attacker can exploit this by sending an unauthenticated DELETE request, such as <code>DELETE /upi/v1/upNodesLinks/gNB1</code>, crashing the handler and, critically, mutating the in-memory user-plane topology before the panic occurs. This allows an off-path network attacker to trigger a state-mutating panic-DoS against any AN entry by name. This vulnerability affects free5GC version 4.2.1.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker identifies a vulnerable free5GC SMF instance with the exposed UPI endpoint.</li>
<li>The attacker crafts a DELETE request targeting the <code>/upi/v1/upNodesLinks/{upNodeRef}</code> endpoint, specifying an AN node name (e.g., <code>gNB1</code>) without any authentication credentials.</li>
<li>The attacker sends the unauthenticated DELETE request to the SMF instance.</li>
<li>The SMF receives the request and proceeds to process it within the <code>DeleteUpNodeLink</code> handler.</li>
<li>The handler identifies the target node as an AN type and executes <code>UpNodeDelete(upNodeRef)</code>, which mutates the in-memory user-plane topology, deleting the specified AN entry.</li>
<li>The handler then attempts to dereference the <code>UPF</code> field of the AN node, which is nil for AN nodes by design.</li>
<li>This dereference results in a nil-pointer dereference, causing a panic in the SMF process.</li>
<li>The SMF returns a 500 Internal Server Error, but the topology has already been mutated, denying SMF&rsquo;s ability to consider that AN in subsequent UPF selection.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The vulnerability allows an unauthenticated attacker to perform a denial-of-service attack against the free5GC SMF. By sending a single, unauthenticated DELETE request, an attacker can delete arbitrary named entries from SMF&rsquo;s in-memory user-plane topology and trigger a panic. This impacts SMF&rsquo;s ability to select UPFs and establish PFCP paths for legitimate UE sessions. The attacker can repeat this process against any AN entry, sustaining the topology denial without needing to authenticate. This can lead to service disruption and impact the availability of the 5G network.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the upstream fix available at <a href="https://github.com/free5gc/smf/pull/199">https://github.com/free5gc/smf/pull/199</a> to patch the nil-pointer dereference in the <code>DeleteUpNodeLink</code> handler.</li>
<li>Implement authentication and authorization middleware on the <code>UPI</code> route group to prevent unauthenticated access, as demonstrated in the <code>nsmf-oam</code> route group; monitor webserver logs for <code>DELETE</code> requests to the <code>/upi/v1/upNodesLinks/</code> endpoint without valid authentication headers.</li>
<li>Deploy the Sigma rule <code>Detect Unauthenticated SMF UPI DELETE Request</code> to identify unauthenticated DELETE requests to the vulnerable endpoint, monitoring webserver logs.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>free5GC</category><category>dos</category><category>vulnerability</category></item></channel></rss>