CVE-2026-138052 — Openairinterface Oai-cn5g-amf — CWE-404
A vulnerability was detected in OpenAirInterface oai-cn5g-amf up to 2.2.2. Impacted is the function amf_sbi::discover_smf of the file src/amf-app/amf_sbi.cpp of the component AMF. The manipulation results in denial of service. The attack can be executed remotely. The exploit is now public and may be used. The patch is identified as 1eabe18bf0cb5a248e0429f4daac91dee51c8a43. It is best practice to apply a patch to resolve this issue.
A vulnerability was detected in OpenAirInterface oai-cn5g-amf up to 2.2.2. Impacted is the function amf_sbi::discover_smf of the file src/amf-app/amf_sbi.cpp of the component AMF. The manipulation results in denial of service. The attack can be executed remotely. The exploit is now public and may be used. The patch is identified as 1eabe18bf0cb5a248e0429f4daac91dee51c8a43. It is best practice to apply a patch to resolve this issue.
🎯 What is this vulnerability?
This vulnerability is a Denial of Service (DoS) flaw classified under CWE-404: Improper Resource Shutdown or Release. It affects the OpenAirInterface (OAI) 5G Core Network implementation, specifically the Access and Mobility Management Function (AMF) component (oai-cn5g-amf) in versions up to and including 2.2.2.
Technical Flaw Analysis:
The vulnerability resides in the function amf_sbi::discover_smf within the file src/amf-app/amf_sbi.cpp. In 5G Core architectures, the AMF communicates with the Session Management Function (SMF) via the Service-Based Interface (SBI), which uses HTTP/2 and JSON over TLS.
The discover_smf function is responsible for locating an available SMF instance, typically by querying the Network Repository Function (NRF) or handling local discovery logic. The "Improper Resource Shutdown or Release" classification suggests that during the discovery process, the AMF fails to properly release resources (such as memory buffers, file descriptors, or network sockets) under specific conditions.
Given the CVSS vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L), the flaw allows an unauthenticated remote attacker to trigger a state where resources are leaked or exhausted, leading to a Low Availability impact. This likely manifests as:
1. Memory Leak: Repeated calls to discover_smf with malformed or specific triggering inputs cause memory to accumulate without being freed, eventually leading to an Out-Of-Memory (OOM) condition and process crash.
2. Socket/Descriptor Leak: The function may open network connections or file descriptors for discovery that are not closed on error paths or specific race conditions, leading to resource exhaustion.
3. Infinite Loop/Deadlock: While less likely for CWE-404, improper shutdown logic could lead to a hang in the discovery thread, blocking the AMF's main event loop.
The attack requires no privileges (PR:N) and no user interaction (UI:N), indicating that the vulnerable endpoint is exposed to the network without authentication, or that the discovery mechanism can be triggered by unauthenticated network traffic (e.g., via the NRF interface or a misconfigured SBI endpoint).
⚡ Attack Chain
1. Discovery & Reconnaissance
- Target Identification: The attacker identifies a 5G Core network deployment using OpenAirInterface. This can be done via: * Banner Grabbing: Scanning for HTTP/2 services on ports typically used for 5G SBI (e.g., 8080, 8443, or custom ports). The
- Endpoint Mapping: The attacker identifies the SBI endpoint responsible for SMF discovery. In OAI, this is likely part of the AMF's internal service interface or exposed via the NRF. The specific URI is not explicitly stated in the CVE, but it is associated with the
discover_smffunction. A typical SBI path for SMF discovery might be/smf-discoveryor triggered via an NRF query forsmfservice. - Hypothesis: The
discover_smffunction allocates a buffer or opens a socket to query the NRF or local SMF list. If the response is malformed, or if the request is repeated rapidly without proper cleanup, resources are not released. - PoC Concept (Illustrative):
User-Agent or Server headers might reveal oai-cn5g-amf or OpenAirInterface.
* NRF Query: If the NRF is exposed, querying it for registered AMF instances can reveal the AMF's IP and port.
* Version Fingerprinting: Checking the version string in API responses or error messages to confirm it is ≤ 2.2.2.
2. Exploitation
The attacker sends a series of requests to the vulnerable endpoint to trigger the resource leak. Since the exact payload is not public in the CVE description, the following is an illustrative example of how such a DoS might be triggered:# Illustrative PoC: Rapidly send requests to the SMF discovery endpoint
# Note: The exact URI and payload are not specified in the CVE.
# This assumes the endpoint is exposed on port 8080 and requires no auth.
for i in {1..10000}; do
curl -s -X POST "http://<target_amf_ip>:8080/smf-discovery" \
-H "Content-Type: application/json" \
-d '{"requestId": "test-'"$i"'", "plmnId": "00101", "snssai": {"sst": 1}}' \
--max-time 1 &
done
wait* Mechanism: Each request triggers amf_sbi::discover_smf. If the function fails to free the allocated memory or close the socket after processing (or on error), the AMF's resource pool depletes.
* Alternative Trigger: If the vulnerability is related to a specific malformed JSON field that causes an exception before the cleanup code runs, the attacker would send a malformed JSON payload (e.g., missing required fields or invalid types) to force an error path that skips resource release.
3. Post-exploitation
C:N/I:N), there is no confidentiality or integrity impact. The attacker does not gain access to data or modify system state.🌍 Real World Impact
🛡️ Remediation & Mitigation
1. Patching
oai-cn5g-amf up to and including 2.2.2.1eabe18bf0cb5a248e0429f4daac91dee51c8a43. This commit likely adds proper resource cleanup (e.g., delete, close(), or free()) in the amf_sbi::discover_smf function, particularly on error paths.2. Workarounds
3. Detection
discover_smf or errors related to resource allocation.[AMF] ERROR: Failed to allocate memory for SMF discovery
[AMF] WARN: High number of concurrent SMF discovery requests⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query