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/api_datarepository.go does not terminate execution after input-processing failures. [file:93]
The request flow is:
- The handler calls
c.GetRawData() to read the HTTP request body. [file:93]
- If
GetRawData() fails, the handler sends an HTTP 500 error response, but does not return. [file:93]
- The handler then calls
openapi.Deserialize(policyDataSubscription, reqBody, "application/json"). [file:93]
- If deserialization fails, the handler sends an HTTP 400 error response, but again does not return. [file:93]
- 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