Summary
free5GC UDM fails to properly validate the SUPI path parameter in several nudm-sdm GET handlers, allowing control characters to be injected into backend requests.
An unauthenticated attacker can trigger malformed requests toward UDR and cause 500 Internal Server Error responses that leak internal infrastructure details through verbose error messages.
Affected context
The vulnerability exists in the UDM component of free5GC's 5G core implementation, specifically within multiple nudm-sdm (Subscriber Data Management) GET endpoints that accept a SUPI as a path parameter.
It manifests when user-supplied SUPI values are accepted directly from HTTP requests and forwarded toward the UDR service without rigorous validation or sanitization, and when backend errors are propagated back to clients with detailed diagnostic information.
Exploit preconditions
- Attack surface: Public or semi-public nudm-sdm HTTP(S) API endpoints exposed by the UDM component.
- Required access: No authentication is required; any network client that can reach the nudm-sdm endpoints can attempt exploitation.
- Trigger point: Sending a crafted GET request to one of the affected UDM nudm-sdm handlers with a SUPI path parameter containing control characters or other malformed data.
- Why exploitation is possible: The SUPI value is not sufficiently validated or normalized before being used in downstream calls to UDR, and error handling returns internal error details (including infrastructure or component information) in 500 Internal Server Error responses.
Why this happens
The core issue is an Improper Input Validation pattern (CWE-20): the service accepts a path parameter (SUPI) and uses it directly when shaping backend requests without enforcing a strict format or rejecting unsafe characters such as control characters.
When these malformed values reach the UDR, they cause backend failures that are not gracefully handled; instead, the resulting exception or error information is propagated back to the client.
This behavior overlaps with CWE-209: Information Exposure Through an Error Message, where detailed internal errors are returned to untrusted callers, unintentionally disclosing implementation and infrastructure details.
Abstractly, the pattern is: untrusted identifier input → no strict validation → backend interaction failure → verbose error surfaced to the client.
Potential impact
- An attacker may obtain detailed stack traces or diagnostic messages from UDM or UDR.
- An attacker may learn internal service names, hostnames, IP ranges, ports, or framework versions used within the free5GC deployment.
- An attacker could map out internal microservice interactions and dependencies between UDM and UDR.
- The leaked information can facilitate further attacks such as targeted exploitation of specific components or services.
General mitigation guidance
Effective mitigation centers on hardening input validation and tightening error handling boundaries:
- Apply strict validation to SUPI path parameters using well-defined formats (e.g., regex or parsing logic that only accepts valid SUPI character sets and structure) and reject or normalize inputs containing control characters or other unexpected bytes.
- Introduce defensive input handling at API boundaries, ensuring all identifiers, especially those used in backend calls, are sanitized and validated before use.
- Implement layered error handling so that backend exceptions are logged internally but mapped to generic, non-verbose error responses for clients, avoiding inclusion of stack traces, internal paths, or topology details.
- Use fail-closed behavior for malformed requests—respond with a clear client error (e.g., 4xx) for invalid SUPI values rather than allowing them to reach backend services.
- Limit the exposure of management and subscriber-data endpoints to only necessary network segments and clients, supporting defense in depth.
How teams detect issues like this
Detection can focus on both code-level signals and runtime behavior:
- Static analysis and code review:
- Flag routes or handlers that accept path parameters (such as SUPI) and pass them directly into backend requests, database queries, or service clients without explicit validation or normalization.
- Look for error handling that returns raw error strings, stack traces, or exception objects directly to HTTP responses.
- Enforce coding guidelines that require explicit validation for identifiers used in inter-service communications.
- Dynamic and operational monitoring:
- Monitor HTTP logs for repeated 500 Internal Server Error responses on nudm-sdm endpoints, especially when associated with unusual or malformed SUPI values.
- Use web application firewalls or API gateways with rules that detect and block control characters or other anomalous patterns in path parameters.
- Periodically perform security testing (e.g., fuzzing of path parameters) against API endpoints to identify cases where malformed input yields verbose error responses.
- Automated security review tools that understand common CWE patterns (CWE-20, CWE-209) can be integrated into CI/CD pipelines to surface similar issues early during development.

