/

CVE-2026-40247

Severity:

HIGH RISK

(7.5)

Improper Access Control in free5GC UDR Traffic Influence

CVE-2026-40247

Analyzed

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-285, CWE-636

Impact:

Unauthorized Data Disclosure

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 UDR versions 4.2.1 and below contain an authorization flaw in the handler for reading Traffic Influence Subscriptions, where a failed path validation still returns subscription data alongside an HTTP 404 response.

An unauthenticated attacker with network access to the 5G Service Based Interface can read arbitrary Traffic Influence Subscription records, including SUPIs/IMSIs, DNNs, S-NSSAIs, and callback URIs, by supplying any value for the influenceId path segment.

Affected context

The issue occurs in the User Data Repository (UDR) service of free5GC 5G core deployments running versions 4.2.1 and below.

It affects the HTTP handler that serves Traffic Influence Subscription resources via the 5G Service Based Interface (SBI).

The vulnerable behavior appears when the path segment intended to identify subscriptions (influenceId) is validated against an expected literal (subs-to-notify), but execution does not stop after sending an HTTP 404 response.

In environments where the UDR SBI is reachable from untrusted or partially trusted networks, this logic error can expose sensitive subscriber and policy-related data to unauthenticated entities.

Exploit preconditions

  • Attack surface: 5G Service Based Interface endpoint of the UDR that exposes Traffic Influence Subscription APIs.
  • Required access: Network-level access to the UDR SBI (e.g., from another network function, management plane, or any entity able to send HTTP requests to the UDR).
  • Authentication/authorization: No valid credentials or tokens are required; the flaw is reachable by unauthenticated callers.
  • Trigger point: An HTTP request to the Traffic Influence Subscription read endpoint using any arbitrary value for the influenceId path segment.
  • Why exploitation is possible: The handler checks if influenceId equals the expected literal (subs-to-notify) and sends a 404 error when it does not match, but fails to return immediately. As a result, the function continues executing and retrieves and returns subscription data in the response body, despite the error status.

Why this happens

This vulnerability stems from incomplete control flow after an authorization/validation check within the UDR HTTP handler.

The code performs a comparison on the influenceId path parameter, intending to restrict access to a specific, expected value.

When the comparison fails, the handler sends an HTTP 404 response but does not terminate execution (e.g., via return or equivalent), allowing subsequent logic to run as though the check had passed.

This pattern maps to CWE-285: Improper Authorization, since the system fails to enforce access control decisions, and also relates to CWE-636: Not Failing Securely, because a failure condition (invalid influenceId) does not result in a safe termination of processing.

Conceptually, the bug is a classic "send error but continue processing" pattern in request handlers, where error handling is not coupled with a hard stop in the control flow.

Potential impact

  • Exposure of Traffic Influence Subscription records that may include SUPIs/IMSIs, allowing correlation to individual subscribers.
  • Leakage of Data Network Names (DNNs) and S-NSSAIs associated with subscribers or traffic policies.
  • Disclosure of callback URIs and associated endpoints, providing additional reconnaissance data for attackers.
  • Violation of privacy and regulatory requirements due to unauthorized access to subscriber identifiers and policy data.
  • Potential facilitation of targeted attacks against other 5G core components using the revealed topology and configuration data.

General mitigation guidance

Effective mitigation focuses on enforcing fail-safe control flow and robust access control around UDR APIs:

  • Ensure that any handler that sends an HTTP error (such as 404 or 403) terminates execution immediately, avoiding further processing of the request.
  • Centralize authorization checks for SBI endpoints and implement them as gatekeepers that decide early whether a request proceeds, ensuring no data access occurs on failed checks.
  • Apply a strict "deny by default" policy for UDR resources, requiring explicit authorization for any subscription or subscriber-related data retrieval, regardless of path parameters.
  • Use structured routing and handler frameworks that couple route validation with automatic short-circuiting when a route or parameter is invalid, minimizing custom error-handling logic.
  • Limit network exposure of the UDR SBI so that only trusted, authenticated network functions can reach it, and segment it away from general-purpose or management networks.
  • Adopt least-privilege service accounts and tokens for internal components that need access to Traffic Influence Subscriptions, ensuring that even legitimate consumers are constrained.

How teams detect issues like this

Organizations can detect similar vulnerabilities in service handlers and API endpoints by combining code-level and system-level approaches:

  • Static analysis and linting: Define rules or patterns to flag handlers that write an HTTP error response but then continue executing logic that may access sensitive data or write another response.
  • Code review practices: During manual review, pay close attention to error-handling branches in HTTP handlers, verifying that every error path returns or otherwise terminates processing.
  • Security-focused unit and integration tests: Add tests that simulate invalid path parameters or authorization failures and assert that no sensitive data appears in the response body for error status codes.
  • Runtime logging and monitoring: Monitor for anomalous 404 responses that contain non-trivial response bodies, especially those including subscription-like payloads, and alert on such patterns.
  • Policy enforcement in CI/CD: Integrate automated tools into the pipeline that check for missing returns after error responses or improper mixing of status codes and data production.

Sources

SourceLink
github.comgithub.com/free5gc/free5gc/security/advisories/GHSA-x5r2-r74c-3w28

Frequently asked

questions

Yes, it can be exploited remotely by any party that has network access to the free5GC UDR Service Based Interface endpoint exposing the Traffic Influence Subscription APIs, without requiring valid credentials.

No. The flaw can be triggered by unauthenticated requests. However, the practical risk depends on how the UDR SBI is exposed in a given deployment; if it is strictly isolated and only reachable from trusted network functions, exploitation opportunities are reduced.

The most robust pattern is to centralize authorization and validation checks and ensure that any failure leads to an immediate return from the handler. Error responses should be the final action for that request, with no further data access or response-body construction.

Prevention involves adopting defensive coding standards for handlers, mandating early-return patterns on error, performing security-focused code reviews, and adding automated tests that confirm no sensitive data is returned with error status codes. Complementary network controls and strict access control policies for the UDR SBI further reduce the attack surface.

Find out what's already
exploitable in your codebase.