Summary
free5GC's PCF Npcf_SMPolicyControl service exposes SM policy management endpoints without enforcing authorization middleware, allowing unauthenticated requests to reach core business logic.
An attacker who can reach these endpoints over the network may access or manipulate SM policy resources and disclose sensitive subscriber identifiers (SUPI) without presenting a valid OAuth token.
Affected context
The vulnerability occurs in free5GC deployments running affected versions of the PCF component, specifically in the Npcf_SMPolicyControl service.
In NewServer(), the smPolicyGroup route group is created without attaching the router authorization middleware, unlike other PCF service groups.
As a result, the following endpoints are exposed without proper authorization checks:
/npcf-smpolicycontrol/v1/sm-policies/npcf-smpolicycontrol/v1/sm-policies/{smPolicyId}/npcf-smpolicycontrol/v1/sm-policies/{smPolicyId}/update/npcf-smpolicycontrol/v1/sm-policies/{smPolicyId}/delete
Any environment where these endpoints are reachable from untrusted networks or shared control planes is at increased risk.
Exploit preconditions
- Attack surface: Network-accessible PCF Npcf_SMPolicyControl HTTP API.
- Required access: Ability to send HTTP requests to the exposed SM policy endpoints; no valid OAuth token is required due to missing middleware.
- Trigger point: Direct invocation of the SM policy handlers via the listed REST routes.
- Why exploitation is possible: The
smPolicyGrouproutes are registered without theRouterAuthorizationCheckmiddleware, so the framework never enforces token validation or authorization before executing business logic.
Why this happens
This issue stems from inconsistent application of authorization middleware in the PCF routing setup.
When the server is initialized, the smPolicyGroup route group for Npcf_SMPolicyControl is created and receives its handlers without attaching the same authorization middleware used by other PCF service groups (such as Npcf_PolicyAuthorization).
This maps to CWE-862: Missing Authorization, where access control is expected but not actually enforced on a resource.
Conceptually, the bug reflects a broken security boundary at the routing layer: security checks are implemented, but not uniformly applied to all relevant routes, leaving a subset of endpoints unprotected.
Potential impact
- Unauthenticated retrieval of subscriber SM policy data.
- Disclosure of sensitive subscriber identifiers (SUPI) and related metadata.
- Unauthorized creation, modification, or deletion of SM policies.
- Potential disruption of subscriber service behavior through policy tampering.
- Increased risk of lateral movement or data correlation when combined with other weaknesses in the 5G core environment.
General mitigation guidance
Effective mitigation focuses on enforcing consistent, centralized authorization for all PCF HTTP routes, particularly those handling subscriber or policy data.
Useful defensive patterns include:
- Ensuring every API route group in the PCF server attaches a common authorization middleware that validates OAuth tokens and enforces policy decisions before business logic runs.
- Adopting a "secure-by-default" routing pattern where new routes inherit mandatory security middleware instead of requiring opt-in configuration.
- Implementing explicit access control checks within SM policy handlers as a defense in depth measure, even when middleware is expected to run.
- Restricting network exposure of PCF interfaces so that only trusted control-plane components can reach Npcf_SMPolicyControl endpoints.
- Applying principle of least privilege for tokens and service accounts that interact with SM policy APIs.
How teams detect issues like this
Detection typically involves a mix of code-level inspection and runtime monitoring:
- Static analysis or linting rules that flag route registrations missing required authorization middleware or annotations.
- Code review checklists that explicitly require verification of authentication and authorization for all new API route groups, especially in control-plane services.
- Automated tests or integration tests that exercise protected endpoints both with and without valid OAuth tokens, asserting that unauthorized requests are rejected.
- API gateway or service mesh policies that log and alert on successful responses to protected paths when no authentication credentials are present.
- Periodic configuration and architecture reviews to ensure consistency between documented security controls and actual implementation in routing code.

