The vulnerability is rooted in improper error handling and information exposure within the free5GC UDM service, specifically when processing HTTP requests with malformed path parameters. The core issue lies in several HTTP handler functions within internal/sbi/api_subscriberdatamanagement.go that failed to validate the supi or ueId path parameters before passing them to downstream business logic.
The primary function identified, Server.HandleModify, which corresponds to the PATCH sdm-subscriptions endpoint mentioned in the advisory, would accept requests with an empty ueId (e.g., from a URL like .../sdm-subscriptions//sub123). This empty identifier was passed to the ModifyProcedure, causing an error in a subsequent request to the UDR service. Instead of propagating the 400 Bad Request from the UDR, the UDM incorrectly converted it to a 500 Internal Server Error, leaking internal error state and violating API best practices.
The provided patch addresses this by introducing input validation at the beginning of HandleModify and other related handlers (HandleGetAmData, HandleUnsubscribe, HandleGetIdTranslationResult). By checking if the supi or ueId is valid before any processing occurs, the patched code can immediately return a proper 400 Bad Request for malformed requests, thus preventing the downstream error and the resulting information leak.