Summary
free5GC UDM up to and including version 1.4.1 leaks detailed internal parsing errors to remote clients when they send invalid pduSessionId values to the Nudm_UECM DELETE service.
This behavior exposes implementation details and enables accurate service fingerprinting, which can assist attackers in reconnaissance and targeted exploitation against 5G core deployments.
Affected context
The vulnerability occurs in free5GC deployments that expose the UDM Nudm_UECM DELETE service.
When clients send malformed or non-numeric pduSessionId values, the service surfaces low-level parsing errors (such as strconv.ParseInt failures) directly in HTTP responses.
Environments where this interface is reachable from untrusted or semi-trusted networks are most at risk, as external actors can probe error behavior without authenticated access.
Exploit preconditions
- Attack surface: Network-facing Nudm_UECM DELETE API endpoint on the UDM component.
- Required access: Ability to send crafted HTTP requests to the UDM Nudm_UECM DELETE interface (typically over service or control-plane networks).
- Trigger point: Submission of invalid or malformed
pduSessionIdparameters that cause parsing to fail. - Why exploitation is possible: The service does not normalize or sanitize error output; instead, it propagates raw parsing error messages and internal details back to the caller, violating robust error handling practices.
Why this happens
The root cause stems from a combination of improper input validation (CWE-20) and improper handling of exceptional conditions (CWE-754).
The pduSessionId parameter is parsed assuming it is well-formed, and failures (e.g., strconv.ParseInt errors) are not abstracted behind generic, user-safe error responses.
Instead, raw library error messages and internal state details are returned to the client, creating a side channel for information disclosure and enabling precise fingerprinting of the stack, language, and implementation.
Conceptually, this reflects a common bug pattern where external inputs are tightly coupled to low-level parsing routines and exception messages without a sanitizing error-handling layer.
Potential impact
- Remote clients can infer implementation details such as language runtime, libraries, and parsing logic.
- Attackers can perform reliable service fingerprinting to confirm the presence and version family of free5GC UDM.
- Error messages may reveal subtle differences in behavior that can be used to map input constraints and internal state.
- Enhanced reconnaissance information can be combined with other vulnerabilities to mount more targeted attacks against 5G core network components.
General mitigation guidance
Mitigation generally involves strengthening both input validation and error-handling boundaries around network-facing APIs:
- Introduce strict validation for
pduSessionIdand other parameters before invoking low-level parsing functions; reject clearly invalid formats early with generic error codes. - Implement a consistent error-handling layer that converts internal exceptions and library messages into coarse-grained, user-safe responses (e.g., generic 4xx/5xx codes with high-level descriptions).
- Avoid returning raw error strings, stack traces, or library-specific text to remote clients; log detailed diagnostics only on the server side with controlled access.
- Apply the principle of least knowledge in responses: return only the minimal information required for client interoperability, not implementation details.
- Consider centralizing API error response templates to enforce uniform, non-verbose messaging across all control-plane interfaces.
How teams detect issues like this
Detection can focus on both runtime behavior and code patterns:
- Black-box testing: Send malformed and boundary-case
pduSessionIdvalues to the Nudm_UECM DELETE endpoint and inspect responses for low-level error text or stack-like messages. - Code review: Look for direct propagation of errors from parsing or conversion functions (e.g.,
strconv.ParseIntresults) into HTTP responses without sanitization. - Static analysis: Configure rules to flag patterns where error messages or exception strings are written directly to client-facing channels (response bodies, headers, or logs exposed via APIs).
- Logging and observability: Monitor for recurring parsing errors tied to external requests; spikes in such errors can indicate active probing for error-based reconnaissance.

