Summary
free5GC UDM versions up to and including 1.4.1 insufficiently validate the supi parameter, allowing remote attackers to inject control characters such as %00.
This malformed input triggers internal URL parsing errors (net/url: invalid control character), causing detailed system error messages to be exposed, which can aid in service fingerprinting and reconnaissance.
Affected context
The vulnerability appears in the Unified Data Management (UDM) component of free5GC when handling requests to the Nudm_UEAU service.
Deployments are affected when:
- The UDM HTTP endpoints are reachable over the network (e.g., from other 5GC components or untrusted network segments).
- Incoming
supiparameters can contain unvalidated, attacker-controlled data. - The service forwards or embeds the
supivalue into internal URLs or request contexts without sanitization.
Under these conditions, crafted control characters in supi can cause low-level URL parsing errors that are propagated back in error responses.
Exploit preconditions
- Attack surface: Network-exposed UDM Nudm_UEAU API endpoints.
- Required access: Ability to send HTTP(S) requests to the UDM (no special privileges beyond network reachability).
- Trigger point: Supplying a
supivalue containing control characters (e.g.,%00or similar) in Nudm_UEAU requests. - Why exploitation is possible: The service performs inadequate validation/normalization on
supibefore using it in URL construction or parsing, allowing invalid characters to reachnet/urlparsing logic and generate detailed error responses.
Why this happens
The underlying issue is an Improper Input Validation (CWE-20) of the supi parameter in the UDM Nudm_UEAU service.
Instead of enforcing strict syntax rules and character whitelists for supi, the application accepts arbitrary input and later passes it into URL-related APIs.
Control characters, such as the null byte (%00), are not filtered or rejected, leading the standard net/url parser to fail with explicit, system-level error messages.
This pattern illustrates a common bug class where untrusted input is used in lower-level protocol or URL handling without normalization, sanitation, or defensive error handling, leaking internal implementation details.
Potential impact
- Attackers can trigger verbose URL parsing errors that expose internal error messages and stack traces.
- Adversaries may fingerprint the free5GC UDM implementation, version, and underlying libraries based on error formats and messages.
- Error responses can reveal internal paths, code modules, or configuration details that could aid subsequent attacks.
- Repeated malformed requests might contribute to log noise or minor resource consumption, potentially amplifying other denial-of-service vectors.
General mitigation guidance
Effective mitigation centers on strict input validation and defensive error handling:
- Apply allowlist-based validation for
supivalues, enforcing the expected 5G identifier format and rejecting any control characters or disallowed bytes before further processing. - Normalize and canonicalize identifiers before passing them into URL builders, routers, or downstream services.
- Avoid reflecting raw parsing error messages from lower-level libraries (such as
net/url) directly to clients; instead, map them to generic, minimal error responses. - Implement centralized input validation routines for all external parameters that may be used in URL construction, routing, or protocol handling.
- Configure logging so that detailed error diagnostics are retained server-side only, with client responses limited to non-sensitive summaries.
How teams detect issues like this
Detection can rely on both code-centric and behavior-centric approaches:
- Static analysis and code review:
- Search for code paths that accept
supifrom HTTP requests and pass it to URL constructors or parsers without explicit validation. - Flag any use of user-controlled identifiers in
net/urlAPIs, route builders, or HTTP proxies where no sanitization occurs. - Review error handling logic to identify places where raw error messages or stack traces are returned to clients.
- Dynamic testing and fuzzing:
- Use API fuzzers to send
supivalues containing control characters, malformed encodings, and protocol edge cases to Nudm_UEAU endpoints and observe responses. - Monitor for HTTP responses containing explicit internal error strings like
net/url: invalid control character. - Operational monitoring:
- Implement WAF or API gateway rules to detect and optionally block requests containing control characters in query parameters or path segments.
- Analyze logs for repeated URL parsing errors tied to malformed
supiinput patterns.

