<?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/tags/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/tags/nef/feed.xml" rel="self" type="application/rss+xml"/><item><title>free5GC NEF Unauthenticated Callback Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-free5gc-nef-auth-bypass/</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-auth-bypass/</guid><description>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.</description><content:encoded><![CDATA[<p>The free5GC NEF (Network Exposure Function) version 4.2.1 contains a critical vulnerability stemming from the lack of inbound authentication on the <code>nnef-callback</code> 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 <code>nnef-callback</code> route group remains reachable even when the runtime <code>ServiceList</code> does not declare it, undermining intended service disabling mechanisms.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker identifies a reachable NEF instance running free5GC v4.2.1.</li>
<li>Attacker crafts a malicious SMF callback request targeting the <code>/nnef-callback/v1/notification/smf</code> endpoint.</li>
<li>The attacker sets the <code>Authorization</code> header with a forged or arbitrary bearer token (e.g., <code>Authorization: Bearer not-a-real-token</code>).</li>
<li>The NEF server receives the request and, due to the missing authentication middleware, parses the request body without validating the token.</li>
<li>The callback handler within the NEF processes the request and attempts to look up subscription state using the provided <code>NotifId</code>.</li>
<li>If the <code>NotifId</code> is valid, the attacker can manipulate subscription data, leading to traffic-influence or PFD-management corruption.</li>
<li>The corrupted subscription data influences downstream SMF/UPF policy decisions, potentially diverting traffic or modifying service quality.</li>
<li>Attacker gains unauthorized control over network traffic and subscriber experience.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The lack of authentication on the <code>nnef-callback</code> 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 <code>NotifId</code> 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.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Detect Unauthenticated NEF Callback Request</code> to identify attempts to exploit the vulnerability by detecting requests to the <code>/nnef-callback/v1/notification/smf</code> endpoint with invalid or suspicious authorization headers (see rule below).</li>
<li>Monitor web server logs for unauthorized POST requests to the <code>/nnef-callback/v1/notification/smf</code> endpoint, referencing the IP address <code>10.100.200.19</code> from the provided PoC.</li>
<li>Upgrade to a patched version of free5GC NEF that addresses the authentication vulnerability (see upstream fix at <a href="https://github.com/free5gc/nef/pull/24)">https://github.com/free5gc/nef/pull/24)</a>.</li>
<li>Apply input validation and authorization checks on all SBI endpoints, especially callback handlers, to prevent unauthorized access and data manipulation.</li>
<li>Review and harden the NEF configuration to ensure that only authorized services and endpoints are exposed, mitigating the risk of unauthorized access.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>5G</category><category>NEF</category><category>Authentication Bypass</category><category>CWE-306</category><category>CWE-862</category></item></channel></rss>