free5GC NRF Type Confusion Vulnerability in /oauth2/token Endpoint
The free5GC NRF's /oauth2/token endpoint is vulnerable to a type confusion vulnerability due to incorrect parsing of form data, leading to a denial-of-service via unauthenticated requests.
A type confusion vulnerability exists in the free5GC NRF (Network Repository Function) version 4.2.1, specifically within the /oauth2/token endpoint. This endpoint, which is intentionally unauthenticated as it is the OAuth2 token issuance endpoint, is susceptible to a parser-level bug. The vulnerability lies in how the NFs/nrf/internal/sbi/api_accesstoken.go handler processes incoming form data. The handler uses reflection on the models.NrfAccessTokenAccessTokenReq struct, but incorrectly treats most fields as models.PlmnId types. This leads to a panic when the parsed value is assigned to a field with an incompatible type, such as slices or different struct pointers. Although the Gin recovery mechanism catches the panic, converting it to an HTTP 500 error, the endpoint remains vulnerable to repeated denial-of-service attacks via single, unauthenticated form-encoded POST requests. This issue affects free5GC version 4.2.1.
Attack Chain
- Attacker sends an HTTP POST request to the
/oauth2/tokenendpoint of the free5GC NRF athttp://10.100.200.3:8000. - The request includes a
Content-Typeheader set toapplication/x-www-form-urlencoded. - The request body contains a URL-encoded parameter, such as
requesterPlmnList,requesterSnssaiList,requesterSnpnList,targetSnpn,targetSnssaiList, ortargetNsiList, with a value intended to trigger the type confusion. For example:requesterPlmnList={"mcc":"208","mnc":"93"}. - The NRF’s
api_accesstoken.gohandler parses the form data and reflects over themodels.NrfAccessTokenAccessTokenReqstruct. - Due to incorrect type handling, the handler attempts to assign a value of type
*models.PlmnIdto a field of an incompatible type (e.g.,[]models.PlmnIdfor therequesterPlmnListfield). - The
reflect.Setoperation panics due to the type mismatch. - The Gin recovery middleware catches the panic and converts it into an HTTP 500 Internal Server Error.
- The NRF process continues to run, but the specific request is not processed successfully, and an error message is logged.
Impact
The type confusion vulnerability (CWE-843) in the /oauth2/token endpoint allows an attacker to cause a denial-of-service (DoS) condition by sending crafted requests. Although the Gin recovery mechanism prevents the NRF process from crashing entirely, each malicious request consumes resources (CPU, log writes due to stack trace generation) and degrades the performance of the token issuance service. An attacker can repeatedly send these requests, potentially impacting legitimate clients and overwhelming the logs. The vulnerability affects free5GC version 4.2.1. There are at least 6 crashing fields which all crash due to the same root cause.
Recommendation
- Monitor webserver logs for HTTP POST requests to the
/oauth2/tokenendpoint (IOC:http://10.100.200.3:8000/oauth2/token) containing parameters known to trigger the vulnerability (e.g.,requesterPlmnList,requesterSnssaiList,targetSnpn) and deploy the “Detect free5GC NRF Type Confusion Attempt” Sigma rule. - Apply the upstream patch available at
https://github.com/free5gc/nrf/pull/83to address the vulnerability. - Upgrade the go/github.com/free5gc/nrf package to a version greater than or equal to 1.4.3 to remediate CVE-2026-44325.
- Implement input validation on the
/oauth2/tokenendpoint to ensure that the types of the request parameters match the expected types in themodels.NrfAccessTokenAccessTokenReqstruct.
Detection coverage 2
Detect free5GC NRF Type Confusion Attempt
highDetects CVE-2026-44325 exploitation attempt — HTTP POST to /oauth2/token with vulnerable parameters
Detect free5GC NRF Type Confusion Panic in Logs
mediumDetects CVE-2026-44325 exploitation — PANIC log message indicating a type confusion during request handling in free5GC NRF
Detection queries are available on the platform. Get full rules →
Indicators of compromise
1
url
| Type | Value |
|---|---|
| url | http://10.100.200.3:8000/oauth2/token |