/

CVE-2026-40246

Severity:

HIGH RISK

(7.5)

Improper Authorization in free5GC UDR Traffic Influence

CVE-2026-40246

Analyzed

Vulnerability type

Category:

Improper Authorization

CWE:

CWE-285

Impact:

Unauthorized Data/Resource Deletion

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 1.4.2 and below contain a logic error in the Traffic Influence Subscription deletion handler where the path validation fails but execution still proceeds to delete the subscription.

An unauthenticated attacker with access to the 5G Service Based Interface can delete arbitrary Traffic Influence Subscriptions while receiving a misleading 404 Not Found response.

Affected context

This vulnerability occurs in the User Data Repository (UDR) service of free5GC (versions 1.4.2 and below) within the Traffic Influence Subscription deletion endpoint.

It manifests when the handler checks whether the influenceId path segment equals subs-to-notify, sends a 404 Not Found on mismatch, but does not terminate execution.

In deployments where the UDR 5G Service Based Interface is reachable without strict network or authentication controls, the buggy code path allows deletion of subscription records regardless of the path validation outcome.

Exploit preconditions

  • Attack surface: 5G Service Based Interface (SBI) exposed by the UDR service.
  • Required access: Network-level access to the UDR SBI endpoint; no valid authentication or authorization is needed.
  • Trigger point: Invocation of the Traffic Influence Subscription deletion API with any influenceId value.
  • Why exploitation is possible: The handler performs a path value check and returns an HTTP 404 response on failure but does not stop executing, so the subsequent deletion logic still runs and removes the targeted subscription.

Why this happens

The underlying issue is a control flow and authorization enforcement defect.

The handler attempts to validate that the influenceId path segment matches an expected value (subs-to-notify), but after sending a 404 response it does not return from the function.

This leads to continued execution of deletion logic even for invalid or unauthorized requests, effectively bypassing intended access control.

Conceptually, this aligns with CWE-285: Improper Authorization, where the system appears to enforce access restrictions but fails to reliably prevent unauthorized operations due to flawed logic and missing early termination after a failed check.

Potential impact

  • Deletion of arbitrary Traffic Influence Subscriptions by unauthenticated parties.
  • Disruption of policy-based traffic steering and routing in 5G core deployments.
  • Potential traffic misrouting, degraded service quality, or denial of service for affected subscribers.
  • Loss of integrity and availability of UDR-managed subscription data.

General mitigation guidance

Effective mitigation focuses on enforcing strict, fail-closed authorization and correcting control flow around validation checks.

Pattern-based measures include:

  • Ensuring that any failed validation or authorization check immediately terminates request handling (e.g., explicit returns after sending error responses).
  • Centralizing authorization decisions so that resource deletion operations cannot occur without passing through a common, well-tested authorization layer.
  • Applying network segmentation and zero-trust principles so that the UDR SBI is only reachable from authenticated and authorized core network functions.
  • Implementing least-privilege service accounts and limiting which components can invoke subscription deletion operations.
  • Using defensive coding patterns (e.g., guard clauses) to reduce the chance of logic paths that proceed after failed checks.

How teams detect issues like this

Detection can combine code-level analysis with behavioral monitoring:

  • Static analysis rules to flag handlers that send an HTTP response but continue executing without an explicit return or error propagation.
  • Code review checklists that require verification that all validation and authorization failures are fail-closed and terminate processing.
  • Policy-based linting or framework-level middleware enforcing that destructive operations (like delete) must be gated by common authorization utilities rather than inline checks.
  • Runtime logging and monitoring to detect unusual patterns of subscription deletions, especially those originating from unauthenticated or unexpected sources.

Sources

SourceLink
github.comgithub.com/free5gc/free5gc/security/advisories/GHSA-g9cw-qwhf-24jp

Frequently asked

questions

Yes, it is remotely exploitable by any party that can reach the UDR's 5G Service Based Interface endpoint exposing the Traffic Influence Subscription deletion API.

No. The described flaw allows unauthenticated deletion of subscriptions, assuming network access to the vulnerable endpoint.

Ensure that after any failed validation or authorization check, the handler exits immediately (e.g., via return) and that deletion logic is only executed within code paths that have explicitly and successfully passed centralized authorization and input validation.

Adopt standardized authorization middleware for all destructive operations, enforce fail-closed patterns in coding guidelines, use automated static analysis to detect code that continues after sending error responses, and include explicit tests for negative authorization cases (invalid IDs, unauthenticated requests) in the API test suite.

Find out what's already
exploitable in your codebase.