Summary
free5GC's Network Exposure Function (NEF) mounted its OAM (operations and maintenance) route group on the SBI without enforcing OAuth2/bearer-token authorization.
An attacker who can reach the NEF over the SBI could invoke OAM endpoints without any Authorization header, and any future management operations added to this route group would inherit the missing auth boundary by default.
Affected context
The issue occurs in free5GC deployments where:
- The NEF service is reachable on the Service Based Interface (SBI), directly or via intermediate proxies
- The NEF OAM route group is mounted without inbound OAuth2/bearer-token middleware
- Network segmentation or API gateways do not fully compensate for missing in-application authorization
Prior to version 4.2.2, the OAM handler itself is a stub that returns null, but the vulnerability lies in the route-group configuration, affecting all OAM operations mapped under this group.
Exploit preconditions
- Attack surface: NEF SBI endpoint exposed within the 5G core control plane network, and potentially reachable from adjacent domains or misconfigured external networks.
- Required access: Network-level ability to send HTTP(S) requests to the NEF SBI address and port; no credentials, tokens, or prior session required.
- Trigger point: HTTP request to an OAM route within the affected route group, even when the request includes no Authorization header.
- Why exploitation is possible: The OAM route group is registered without attaching OAuth2 or bearer-token middleware, so the NEF processes requests as valid despite the absence of authentication and authorization checks. Any future management or configuration operations added to this group inherit the same missing control.
Why this happens
The root cause is a missing authentication and authorization boundary on a sensitive route group in the NEF service.
Instead of enforcing OAuth2/bearer-token checks at the OAM route group level, the routes are mounted without any inbound auth middleware. This corresponds to:
- CWE-306: Missing Authentication for Critical Function, because operations under an OAM route are inherently privileged and should always require strong authentication.
- CWE-862: Missing Authorization, since the NEF does not verify whether the caller is authorized to perform OAM operations.
Structurally, the route-group-scoped design defect means that every new OAM handler added under this group is unauthenticated by default, unless individual handlers override the behavior, which is easy to overlook.
Potential impact
- Unauthenticated access to current and future NEF OAM endpoints
- Potential modification of NEF configuration or policies if management operations are later added to this route group
- Unauthorized retrieval of operational or diagnostic information from the 5G core
- Disruption or degradation of NEF-related services through unmanaged OAM commands
- Lateral movement or expanded control within the 5G core control plane if OAM endpoints are used to manipulate other network functions or integrations
General mitigation guidance
Effective mitigation focuses on enforcing strong, centralized authentication and authorization boundaries around OAM and management APIs:
- Attach OAuth2/bearer-token validation (or equivalent strong authentication) at the route-group level for all OAM/management endpoints, not just individual handlers.
- Define OAM routes under a clearly separated URL namespace or service component that always applies auth middleware by default.
- Apply role-based authorization checks for OAM operations, ensuring that only explicitly authorized roles can invoke management actions.
- Use defense-in-depth: segment management plane traffic on dedicated networks, and restrict reachability of NEF OAM endpoints via firewalls and API gateways.
- Adopt secure-by-default route registration patterns (e.g., helper functions that always include auth middleware) so new OAM endpoints cannot be added without protection.
- Minimize privileges for NEF service accounts and credentials so that compromise of an endpoint does not automatically grant broad control of the 5G core.
How teams detect issues like this
Detection approaches can combine code-centric and operational perspectives:
- Static analysis / linting:
- Flag registration of OAM or /admin-style route groups that lack attached auth middleware or do not validate tokens.
- Search for HTTP handlers under OAM namespaces that read or modify configuration without calling authentication/authorization helpers.
- Code review practices:
- Require explicit documentation of auth requirements for any new OAM or management endpoint.
- Review route-group setup code to confirm that all sensitive routes inherit authentication and authorization by default.
- Runtime and logging controls:
- Monitor NEF access logs for OAM endpoints being hit without Authorization headers and alert on such events.
- Use API gateways or service meshes with policies that enforce authentication on OAM paths, and configure alerts for policy violations.
- Security testing:
- Include tests in CI/CD that attempt unauthenticated calls to OAM/management paths and fail builds if any requests succeed.

