CVE-2026-40343: free5GC UDR: Fail-open handling in PolicyDataSubsToNotifyPost allows unintended subscription creation

Published Apr 21, 2026
·
Updated

Summary A fail-open request handling flaw in the UDR service causes the /nudr-dr/v2/policy-data/subs-to-notify POST handler to continue processing requests even after request body retrieval or deserialization errors.

This may allow unintended creation of Policy Data notification subscriptions with invalid, empty, or partially processed input, depending on downstream processor behavior.

Details The endpoint POST /nudr-dr/v2/policy-data/subs-to-notify is intended to create a Policy Data notification subscription only after the HTTP request body has been successfully read and parsed into a valid PolicyDataSubscription object. [file:93]

In the free5GC UDR implementation, the function HandlePolicyDataSubsToNotifyPost in NFs/udr/internal/sbi/apidatarepository.go does not terminate execution after input-processing failures. [file:93]

The request flow is:

1. The handler calls c.GetRawData() to read the HTTP request body. [file:93] 2. If GetRawData() fails, the handler sends an HTTP 500 error response, but does not return. [file:93] 3. The handler then calls openapi.Deserialize(policyDataSubscription, reqBody, "application/json"). [file:93] 4. If deserialization fails, the handler sends an HTTP 400 error response, but again does not return. [file:93] 5. Execution continues and the handler still invokes s.Processor().PolicyDataSubsToNotifyPostProcedure(c,policyDataSubscription). [file:93]

As a result, the endpoint operates in a fail-open manner: request processing may continue after fatal input validation or body handling errors, instead of being safely aborted. [file:93]

This differs from safer handlers in the same file, which use a helper pattern that explicitly returns on body read or deserialization failure before calling the corresponding processor routine. [file:93]

Security Impact This issue affects a write-capable API that creates Policy Data notification subscriptions. [file:93] Because execution continues after body read or parsing failure, the processor may receive an uninitialized, partially initialized, or otherwise unintended PolicyDataSubscription object. [file:93]

The exact runtime impact depends on downstream processor behavior and storage validation. [file:93] At minimum, this is a security-relevant robustness flaw that can lead to inconsistent request handling; under certain runtime conditions it may allow creation of invalid or unintended subscription state. [file:93]

Reproduction Status The code path has been statically confirmed. [file:93] A complete runtime proof of unintended subscription creation after GetRawData() or deserialization failure has not yet been established. [file:93]

Patch The handler should immediately terminate after sending an error response for body read or deserialization failure. [file:93]

A minimal fix is to add missing return statements in HandlePolicyDataSubsToNotifyPost:

go reqBody, err := c.GetRawData() if err != nil { logger.DataRepoLog.Errorf("Get Request Body error: %+v", err) pd := openapi.ProblemDetailsSystemFailure(err.Error()) c.Set(sbi.INPBDETAILSCTXSTR, pd.Cause) c.JSON(http.StatusInternalServerError, pd) return }

err = openapi.Deserialize(&policyDataSubscription, reqBody, "application/json") if err != nil { logger.DataRepoLog.Errorf("Deserialize Request Body error: %+v", err) pd := util.ProblemDetailsMalformedReqSyntax(err.Error()) c.Set(sbi.INPBDETAILSCTXSTR, pd.Cause) c.JSON(http.StatusBadRequest, pd) return } Additionally, the deserialization call should pass a pointer to the destination object so that the parsed body is written into the intended structure. [file:93]

###Details The issue is compounded by the handler's deserialization call, which passes policyDataSubscription directly to openapi.Deserialize(...) instead of passing a pointer to the destination object. This inconsistent usage further increases the risk that request processing continues with an empty, partially initialized, or otherwise unintended subscription object. [file:93]

Other sources

free5GC UDR is the user data repository (UDR) for free5GC, an an open-source project for 5th generation (5G) mobile core networks. In versions up to and including 1.4.2, a fail-open request handling flaw in the UDR service causes the /nudr-dr/v2/policy-data/subs-to-notify POST handler to continue processing requests even after request body retrieval or deserialization errors. This may allow unintended creation of Policy Data notification subscriptions with invalid, empty, or partially processed input, depending on downstream processor behavior. As of time of publication, a patched version is not available.

MITRE

Affected Software

3 affected components
go/github.com/free5gc/udr<=1.4.2
free5gc Free5gc<=4.2.1
free5gc Udr Go<=1.4.2

Event History

Apr 21, 2026
Advisory Published
via GitHub·07:05 PM
Data Sourced
via GitHub·07:05 PM
DescriptionWeaknessAffected Software
Data Sourced
via GitHub·07:05 PM
Severity
CVE Published
via MITRE·11:47 PM
Data Sourced
via MITRE·11:47 PM
DescriptionWeakness
Apr 22, 2026
Data Sourced
via NVD·12:16 AM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-40343?

CVE-2026-40343 has a medium severity rating due to its potential to allow unintended subscription creation.

2

How do I fix CVE-2026-40343?

To fix CVE-2026-40343, upgrade to the latest version of free5GC UDR beyond version 1.4.2 and ensure proper handling in the PolicyDataSubsToNotifyPost endpoint.

3

Which versions are affected by CVE-2026-40343?

CVE-2026-40343 affects free5GC UDR versions up to and including 1.4.2 and Free5gc versions up to and including 4.2.1.

4

What kind of flaw is CVE-2026-40343?

CVE-2026-40343 is a fail-open handling flaw that allows the processing of requests without proper validation.

5

Can CVE-2026-40343 impact system security?

Yes, CVE-2026-40343 can lead to security issues by allowing unintended subscription creation, potentially affecting the integrity of the system.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203