Details
The exact exploitability depends on whether the attacker can correlate log access with an active authentication context and submit the confirmation before the context is consumed or failed. Regardless, writing XRES* to application logs is an unsafe handling of authentication material.
Timing side channel / cryptographic hardening issue
The non-constant-time comparisons are real code issues and should be fixed, but we did not demonstrate a practical remote timing oracle over HTTP/SBI. The measured comparator signal is too small relative to HTTP noise in the lab.
The risk is higher in environments where an attacker has a lower-noise measurement point, local co-residency, kernel tracing capabilities, or another side channel that can observe the comparison more directly.
Suggested remediation
- Remove
XRES*,RES*,XRES,RES,K_aut,AT_MAC, and derived authentication material from INFO logs. If logging is necessary, log only metadata such as the authentication context ID, SUPI/SUCI in redacted form, result, and failure class.
- Replace
strings.EqualFold()and string==comparisons for authentication values with constant-time comparisons.
- Normalize encodings before comparison. For hex-encoded values, decode both inputs first, validate expected lengths, and then compare fixed-size byte slices.
Example for 5G-AKA:
resStar, err1 := hex.DecodeString(updateConfirmationData.ResStar)
xresStar, err2 := hex.DecodeString(ausfCurrentContext.XresStar)
if err1 == nil && err2 == nil &&
len(resStar) == len(xresStar) &&
subtle.ConstantTimeCompare(resStar, xresStar) == 1 {
// success
} else {
// failure
}
Example for EAP-AKA' MAC:
if len(MAC) != len(XMAC) || subtle.ConstantTimeCompare(MAC, XMAC) != 1 {
eapOK = false
eapErrStr = "EAP-AKA' integrity check fail"
}
Example for EAP-AKA' XRES:
res, err1 := hex.DecodeString(RES)
xres, err2 := hex.DecodeString(XRES)
if err1 == nil && err2 == nil &&
len(res) == len(xres) &&
subtle.ConstantTimeCompare(res, xres) == 1 {
// success
}
- Add unit tests that ensure authentication values are not written to logs.
- Consider avoiding a second UDM notification call in the 5G-AKA failure path if the first failure notification already reports the result. In the lab, failure performed two UDM calls while success performed one; this creates a coarse success/failure timing difference, although that result is already visible through the API response.
Prior art / non-duplication note
Known recent free5GC AUSF issues such as CVE-2026-33063 concern different failure modes and code paths. This report concerns cryptographic comparison and logging behavior in internal/sbi/processor/ue_authentication.go.