Summary
The AMF in Free5GC v4.2.1 does not enforce the concurrent security procedure rules defined in 3GPP TS 33.501 §6.9.5.1. The AMF does not check for ongoing N2 handover procedures before initiating a NAS Security Mode Command, and vice versa. This can lead to mismatches between NAS and AS security contexts in the network and the UE.
Details
Vulnerability Type: CWE-358 (Improperly Implemented Security Check for Standard)
Affected File: internal/ngap/handler.go, handleHandoverRequiredMain() and internal/gmm/sm.go, SecurityMode()
Root Cause:
3GPP TS 33.501 §6.9.5.1 states:
"Concurrent runs of security procedures may, in certain situations, lead to mismatches between security contexts in the network and the UE. In order to avoid such mismatches, the following rules shall be adhered to:
- AMF shall not initiate any of the N2 procedures including a new key towards a UE if a NAS Security Mode Command procedure is ongoing with the UE.
- The AMF shall not initiate a NAS Security Mode Command towards a UE if one of the N2 procedures including a new key is ongoing with the UE."
Free5GC AMF uses an OnGoing state tracking mechanism (SetOnGoing(), GetOnGoing()) with OnGoingProcedureN2Handover type. However, the cross-procedure checks required by §6.9.5.1 are not implemented:
Rule 2 violation:SecurityMode() in internal/gmm/sm.go sends SMC on EntryEvent without checking if N2 handover is ongoing.
Rule 1 violation:handleHandoverRequiredMain() in internal/ngap/handler.go calls SetOnGoing(OnGoingProcedureN2Handover) without checking if SMC is ongoing.
Why NH/NCC and SMC are related:
SMC activates a new KAMF, which changes the basis for NH key derivation. The N2 HandoverRequest includes NH/NCC derived from the old KAMF. If both procedures run concurrently, the target gNB and UE derive different KgNB keys, breaking AS security.
PoC
Source code evidence:
Free5GC AMF internal/gmm/sm.go, SecurityMode():
func SecurityMode(state *fsm.State, event fsm.EventType, args fsm.ArgsType) {
switch event {
case fsm.EntryEvent:
// No check for OnGoing N2 procedure
// Directly proceeds to SMC
Free5GC AMF internal/ngap/handler.go, handleHandoverRequiredMain():
amfUe.SetOnGoing(sourceUe.Ran.AnType, &context.OnGoing{
Procedure: context.OnGoingProcedureN2Handover,
})
// No check for ongoing SMC before setting N2
Packet Evidence (pcap available):
| Packet | Time | Message | Description |
|---|---|---|---|
| #1 | 0.000s | HandoverRequired | gNB_A requests handover |
| #18 | 0.002s | HandoverRequest | N2 started (NH/NCC included) |
| (no response from gNB_B) | N2 ongoing | ||
| #28 | 2.062s | Registration request | UE re-registers (same SUPI) |
| #63 | 2.069s | Authentication request | |
| #64 | 2.070s | Authentication response | |
| #71 | 2.072s | Security mode command | SMC during N2 ongoing = Rule 2 violation |
| NGAPHandover-N2-SMC-Concurrent.zip |
Impact
Integrity (MEDIUM): Concurrent NAS and AS security procedures can cause security context mismatches between UE, AMF, and gNB. The SMC activates a new KAMF while the N2 HandoverRequest carries NH/NCC derived from the old KAMF, resulting in KgNB derivation mismatch.
Availability (LOW): Security context mismatch may cause handover failure or security verification failures.
CVE-2026-42082 has a CVSS score of 3.7 (Low). The vector is reachable from an adjacent network, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. No fixed version is listed yet, so configuration controls and monitoring matter more in the interim.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-42082? CVE-2026-42082 is a low-severity security vulnerability in github.com/free5gc/amf (go), affecting versions <= 1.4.3. No fixed version is listed yet.
- How severe is CVE-2026-42082? CVE-2026-42082 has a CVSS score of 3.7 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/free5gc/amf are affected by CVE-2026-42082? github.com/free5gc/amf (go) versions <= 1.4.3 is affected.
- Is there a fix for CVE-2026-42082? No fixed version is listed for CVE-2026-42082 yet. Monitor the advisory for updates and apply mitigations in the interim.
- Is CVE-2026-42082 exploitable, and should I be worried? Whether CVE-2026-42082 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-42082 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.