# CVE-2026-40249: free5gc UDR fail-open request handling in PolicyDataSubsToNotifySubsIdPut may allow unintended subscription updates…

Source: https://junglewise.ai/threats/cve-2026-40249-free5gc-udr-fail-open-request-handling-in  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-04-14. Updated: 2026-05-11  
License: CC BY 4.0 with a link back

CVE-2026-40249 · Severity: medium · CVSS 5.3 · Published 2026-04-14

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

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

### Details
The endpoint `PUT /nudr-dr/v2/policy-data/subs-to-notify/{subsId}` is intended to update an existing 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 `HandlePolicyDataSubsToNotifySubsIdPut` in`NFs/udr/internal/sbi/api_datarepository.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().PolicyDataSubsToNotifySubsIdPutProcedure(c, subsId, 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]

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]

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 updates Policy Data notification subscriptions identified by `subsId`. [file:93]  
Because execution continues after body read or parsing failure, the processor may receive an uninitialized, partially initialized, or otherwise unintended `PolicyDataSubscription` object for persistence. [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 or unintended modification attempts; under certain runtime conditions it may allow updates that should not be processed after an input error. [file:93]

### Reproduction Status
The code path has been statically confirmed. [file:93]  A complete runtime proof of unintended subscription modification 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 `HandlePolicyDataSubsToNotifySubsIdPut` and pass a pointer to the destination
object during deserialization: [file:93]

```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.IN_PB_DETAILS_CTX_STR, 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.IN_PB_DETAILS_CTX_STR, pd.Cause)
    c.JSON(http.StatusBadRequest, pd)
    return
}
```

Technologies: [github.com/free5gc/udr (Go)](https://junglewise.ai/threats/technologies/github-com-free5gc-udr). Vendors: [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2026-40249 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-40249 being exploited in the wild.

**How severe is CVE-2026-40249?** Medium severity, with a CVSS score of 5.3, published 14 April 2026.

**Which products and versions are affected?** github.com/free5gc/udr (Go) <= 1.4.2, SEMVER:introduced=0, SEMVER:introduced=0,last_affected=1.4.2.

**Is there a fix for CVE-2026-40249?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**Am I affected by CVE-2026-40249?** Check whether you run github.com/free5gc/udr (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Affected products

- github.com/free5gc/udr (Go) <= 1.4.2, SEMVER:introduced=0, SEMVER:introduced=0,last_affected=1.4.2

## Identifiers

- CVE-2026-40249
- GHSA-gx38-8h33-pmxr
- GO-2026-5407

## References

- [https://api.github.com/users/Giancannella](https://api.github.com/users/Giancannella)
- [https://github.com/Giancannella](https://github.com/Giancannella)
- [https://api.github.com/users/Giancannella/gists%7B/gist_id%7D](https://api.github.com/users/Giancannella/gists%7B/gist_id%7D)
- [https://api.github.com/users/Giancannella/repos](https://api.github.com/users/Giancannella/repos)
- [https://avatars.githubusercontent.com/u/56028149?v=4](https://avatars.githubusercontent.com/u/56028149?v=4)
- [https://api.github.com/users/Giancannella/events%7B/privacy%7D](https://api.github.com/users/Giancannella/events%7B/privacy%7D)

## Related threats

- [free5GC UDR improper input validation in EE subscription handlers](https://junglewise.ai/threats/cve-2026-47780-free5gc-udr-improper-input-validation-in-ee-subscription-handlers)
- [free5GC UDR denial of service via nil type assertion](https://junglewise.ai/threats/cve-2026-44324-free5gc-udr-denial-of-service-via-nil-type-assertion)
- [free5GC UDR nil pointer dereference in nudr-dr DELETE handler](https://junglewise.ai/threats/cve-2026-44323-free5gc-udr-nil-pointer-dereference-in-nudr-dr-delete-handler)
- [free5GC UDR: Fail-open handling in PolicyDataSubsToNotifyPost allows unintended subscription creation](https://junglewise.ai/threats/cve-2026-40343-free5gc-udr-fail-open-handling-in-policydatasubstonotifypost)
- [free5gc UDR improper path validation allows unauthenticated deletion of Traffic Influence Subscriptions](https://junglewise.ai/threats/cve-2026-40246-free5gc-udr-improper-path-validation-allows-unauthenticated)
