/

CVE-2026-40245

Severity:

HIGH RISK

(7.5)

Information Disclosure in free5GC UDR InfluenceData API

CVE-2026-40245

Analyzed

Vulnerability type

Category:

Information Disclosure

CWE:

CWE-200, CWE-202, CWE-209

Impact:

Exposure of Sensitive Subscriber Identifiers (SUPI/IMSI) over the Network

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

free5GC's UDR service contains an information disclosure flaw where an HTTP 400 error response is constructed but execution continues into the normal processing path.

As a result, an unauthenticated attacker can issue a parameterless or malformed GET request to the Traffic Influence Subscription endpoint and receive subscriber identifiers (SUPI/IMSI) in the response body, violating core network privacy expectations.

Affected context

This vulnerability affects deployments of free5GC (versions 4.2.1 and below) where:

  • The UDR (Unified Data Repository) service is deployed and reachable over the 5G Service Based Interface (SBI).
  • The /nudr-dr/v2/application-data/influenceData/subs-to-notify API is exposed to network clients, such as other network functions or test tools.
  • Error handling paths do not terminate request processing after sending an HTTP 400 response.

In typical 5G core lab or production setups, the UDR is expected to be accessible only from trusted NFs, but incomplete network segmentation or misconfiguration can make it reachable to broader network actors.

Exploit preconditions

  • Attack surface: HTTP-based 5G SBI endpoint on the UDR (/nudr-dr/v2/application-data/influenceData/subs-to-notify).
  • Required access: Network-level access to the UDR's SBI interface; no authentication or prior session state is required.
  • Trigger point: Sending an HTTP GET request without the required query parameters, or with a malformed snssai parameter, causing the handler to set a 400 error but continue into the normal processing logic.
  • Why exploitation is possible: The request handler constructs a 400 Bad Request error response but fails to return or otherwise abort execution. Control flow falls through into the processor function, which queries the data repository and appends the full list of Traffic Influence Subscriptions, including SUPI/IMSI values, to the response body, effectively delivering sensitive data alongside an error status.

Why this happens

The root cause is an error-path control-flow bug where the server:

  1. Detects missing or malformed query parameters and sets an HTTP 400 error response.
  2. Does not terminate request handling (no return or equivalent), allowing the function to continue into the normal processing logic.

This pattern maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, with contributing aspects of:

  • CWE-202: Exposure of Sensitive Information Through Data Queries, as the logic still performs a broad query of subscriber data even when the request is invalid.
  • CWE-209: Generation of Error Message Containing Sensitive Information, because the error response is combined with sensitive payload content.

Abstractly, the insecure pattern is: "On an invalid request, the application partially constructs an error response but continues to execute business logic that fetches and attaches sensitive data, instead of aborting the request."

Potential impact

  • Disclosure of SUPI and IMSI values for stored Traffic Influence Subscriptions to unauthenticated network clients.
  • Undermining of subscriber privacy guarantees, effectively bypassing SUCI-based identifier concealment at the core network layer.
  • Increased risk of subscriber tracking, profiling, or correlation across network slices and services.
  • Intelligence gathering for further targeted attacks against specific subscribers or regions.
  • Potential regulatory or compliance impact due to leakage of personally identifiable telecommunications data.

General mitigation guidance

Effective mitigation focuses on enforcing strict control-flow termination and minimizing data exposure on error paths:

  • Ensure that all handlers return immediately (or otherwise stop processing) after constructing an error response, especially when required parameters are missing or invalid.
  • Centralize error handling so that validation failures are resolved before any business logic runs, preventing data-access code from executing for malformed or unauthenticated requests.
  • Restrict the data returned by APIs on error conditions to generic, non-sensitive messages; never attach domain data to 4xx/5xx responses.
  • Apply least data principles by querying and returning only the minimal fields required for each valid request, rather than broad lists of full subscription objects.
  • Harden deployment by limiting SBI exposure using network segmentation, mutual TLS, and strict ACLs so only authorized network functions can connect to the UDR.
  • Incorporate privacy-by-design practices for subscriber identifiers, treating SUPI/IMSI as high-sensitivity fields that must never be emitted to untrusted or unauthenticated peers.

How teams detect issues like this

Organizations can identify similar issues using a mix of code-focused and runtime techniques:

  • Static analysis and code scanning:
  • Flag handler functions that write error responses (e.g., http.Error, SetStatus(400)) but lack an immediate return or explicit termination.
  • Detect branches where validation fails but subsequent code still performs data queries or serialization.
  • Search for error paths that reference or marshal high-sensitivity fields such as SUPI, IMSI, or subscriber profiles.
  • Code review practices:
  • Review HTTP handlers with an emphasis on control flow: validation, authorization, and early returns before any data access.
  • Verify that all error responses use generic messages without embedding business-domain data.
  • Check that API contracts clearly differentiate between successful and error responses and that implementations conform to those contracts.
  • Runtime and testing approaches:
  • Implement negative-test suites sending malformed, incomplete, or parameterless requests to all UDR/SBI endpoints and inspect responses for unexpected data.
  • Use privacy-focused testing to ensure that SUPI/IMSI and similar identifiers never appear in responses to unauthenticated or invalid requests.
  • Automated security testing and API gateways can be configured to monitor for unusual large payloads or sensitive identifiers in error responses.

Sources

SourceLink
github.comgithub.com/free5gc/free5gc/security/advisories/GHSA-wrwh-rpq4-87hf

Frequently asked

questions

Exploitability depends on network topology. The issue is reachable from any entity with network access to the UDR's SBI endpoint; in a hardened deployment this is typically limited to other core network functions, but in lab, test, or poorly segmented environments it could be reachable from broader internal networks or even the internet.

No. The flaw occurs before any meaningful access control, so an unauthenticated client that can send HTTP requests to the UDR endpoint can trigger the information disclosure by issuing a parameterless or malformed GET request.

The most robust fix is to enforce early validation with immediate termination: validate all required parameters first, return a clean error response on failure, and ensure no business logic runs after an error is set. Additionally, remove any code that attaches or logs sensitive subscriber data as part of error responses.

Prevention relies on a combination of defensive coding and privacy-aware design: treat identifiers like SUPI/IMSI as highly sensitive, enforce strict separation between validation/error paths and data access, use central error-handling utilities that never include domain data, and incorporate static analysis and negative testing in CI to catch handlers that set error statuses but still access or serialize sensitive information.

Find out what's already
exploitable in your codebase.