GitHub Advisoryadvisory · Go
GHSA-585v-hcgf-jhfr Free5GC UDM has Improper Input Validation and Generation of Error Messages Containing Sensitive Information
HIGH
Official page ↗
- Aliases
- CVE-2026-42459
- Ecosystem
- Go
- Packages
- github.com/free5gc/udm
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Weaknesses
- CWE-20, CWE-209
- Reviewed
- 2026-05-07
Affected packages
• Go github.com/free5gc/udm: <= 1.4.3 (no fix yet)
Description
Summary
The free5GC UDM component fails to validate the `supi` path parameter in six GET handlers of the `nudm-sdm` (Subscriber Data Management) service. An unauthenticated attacker can inject control characters into the SUPI parameter, causing UDM to forward a malformed request to UDR and return a `500 Internal Server Error` response that exposes internal infrastructure details.
Affected Package
• Ecosystem: Go
• Package: `github.com/free5gc/udm`
• Affected versions: `/nudm-sdm/v2/imsi-22277%00INJECTED/smf-select-data"
curl "http:///nudm-sdm/v2/imsi-22277%00INJECTED/nssai"
curl "http:///nudm-sdm/v2/imsi-22277%00INJECTED/trace-data"
curl "http:///nudm-sdm/v2/imsi-22277%00INJECTED/sm-data"
Expected (vulnerable) response:
HTTP 500
{
"title": "System failure",
"status": 500,
"detail": "parse \"http://udr.internal:80/nudr-dr/v2/subscription-data/imsi-22277\x00INJECTED//provisioned-data/smf-selection-subscription-data\": net/url: invalid control character in URL",
"cause": "SYSTEM_FAILURE"
}
Protected endpoint (for comparison) — returns 400
curl "http:///nudm-sdm/v2/imsi-22277%00INJECTED/am-data"
HTTP 400
{"title":"Malformed request syntax","status":400,"detail":"Supi is invalid","cause":"MANDATORY_IE_INCORRECT"}
```
Impact
An unauthenticated remote attacker can send a crafted GET request to any of the six affected endpoints to obtain:
1. Internal UDR hostname and port
2. Full internal API path structure (`/nudr-dr/v2/subscription-data/...`)
3. UDR API version
4. Internal service naming convention
This information can be used to facilitate further attacks against the UDR or other internal 5G core components.
Recommended Fix
Add `validator.IsValidSupi()` to all six affected handlers, following the pattern already used in `HandleGetAmData`:
```go
supi := c.Params.ByName("supi")
if !validator.IsValidSupi(supi) {
problemDetail := models.ProblemDetails{
Title: "Malformed request syntax",
Status: http.StatusBadRequest,
Detail: "Supi is invalid",
Cause: "MANDATORY_IE_INCORRECT",
}
c.Set(sbi.IN_PB_DETAILS_CTX_STR, http.StatusText(int(problemDetail.Status)))
c.JSON(int(problemDetail.Status), problemDetail)
return
}
```
Related
Alias · CVE (1)
- CVE-2026-42459 free5GC is an open-source implementation of the 5G core network. vulnerability
References
- https://github.com/free5gc/free5gc/security/advisories/GHSA-585v-hcgf-jhfr web
- https://github.com/free5gc/free5gc/security/advisories/GHSA-h4wg-rp7m-8xx4 web
- https://nvd.nist.gov/vuln/detail/CVE-2026-42459 advisory
- https://github.com/free5gc/free5gc package
- https://github.com/free5gc/udm/blob/v1.4.3/internal/sbi/api_subscriberdatamanagement.go web