Skip to main content

Free5GC AMF CVE-2026-42082

| EUVDEUVD-2026-32556 MEDIUM
Improperly Implemented Security Check for Standard (CWE-358)
2026-05-07 https://github.com/free5gc/free5gc GHSA-vrrx-58h3-prmh
5.4
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Trigger handover
  2. Delivery
    Send NGAP HandoverRequest
  3. Exploit
    UE re-registers concurrently
  4. Install
    AMF initiates NAS SMC during N2 ongoing
  5. C2
    SMC activates new KAMF
  6. Execute
    Target gNB derives KgNB from old KAMF NH/NCC
  7. Impact
    UE derives KgNB from new KAMF
  8. Step 8
    AS security context mismatch

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V12 - Secure Communication Improperly implemented security check
Exploitation Conditions

Exploitation requires: (1) Free5GC AMF version <= 1.4.3 deployed in a 5G core network with NGAP handover capability enabled; (2) an active UE performing N2 handover from source to target gNB with pending NGAP HandoverRequest message; (3) concurrent NAS procedure triggering (e.g., re-registration, key refresh) that invokes SecurityMode() while OnGoingProcedureN2Handover state is still set in the AMF; (4) network conditions or subscriber policy causing SMC to be initiated before HandoverComplete or HandoverFailure clears the N2 state. The attack does not require authentication bypass or non-standard configuration - it exploits the default AMF behavior during routine mobility procedures. Limiting factors: (a) requires timing synchronization between N2 and NAS layers, raising exploitation complexity; (b) handover procedure typically completes or fails within seconds, creating a narrow exploitation window; (c) not all UE activity triggers concurrent procedures (static UEs without re-registration are unaffected); (d) packet evidence suggests the condition is reproducible but not continuous. The vulnerability is NOT remote-unauthenticated (requires UE context and NGAP association) and is NOT automatic (requires specific procedural sequence), but is deterministic in networks performing active mobility.

Impact

CVSS 3.7 (AV:A/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L) indicates adjacent network access, high complexity, and low privilege requirement with integrity and availability impact but no confidentiality risk. However, this CVSS underestimates real-world impact: the vulnerability requires specific timing conditions (SMC initiated during N2 handover window) and local or adjacent network positioning to trigger, but the integrity impact (KgNB mismatch) can lead to complete AS security failure, not just 'limited' impact. No EPSS data or KEV status provided; no active exploitation reported, but proof-of-concept source code and packet evidence exist, confirming reproducibility and technical feasibility. The low CVSS score reflects high complexity (AC:H, requiring concurrent procedure timing) and adjacency requirement (AV:A, suggesting handover typically occurs during active UE attachment), not low real-world risk. Risk priority depends on deployment: production 5G networks with active handovers are at elevated risk; isolated test labs or networks without concurrent N2/NAS procedures are at minimal risk. The integrity impact (security context mismatch) is severe but conditional; availability risk (handover failure) is secondary. Compare with SSVC: exploitation is proof-of-concept (demonstrated via source code and pcap), technical impact is high (complete AS security bypass in affected UEs during handover), automatable only within handover windows (not continuous), and affected population is mobile users during active handover. Recommended priority: Medium for production 5G networks, Low for non-handover-intensive deployments.

Exploit ScenarioDerived

An attacker (or natural network condition) triggers concurrent N2 handover and NAS SMC as follows: UE initiates handover from source gNB_A to target gNB_B, triggering HandoverRequired message. Source gNB sends NGAP HandoverRequest (packet #18 in provided pcap) containing NH/NCC derived from current KAMF. Meanwhile, UE re-registers (packet #28), triggering authentication and subsequently NAS SMC (packet #71) at 2.072 seconds. The AMF SecurityMode() function does not check that N2 handover is ongoing (SetOnGoing never cleared), so SMC is sent while HandoverRequest is pending, activating a new KAMF. Target gNB derives KgNB from the old KAMF's NH/NCC (from packet #18), while UE derives KgNB from the new KAMF (post-SMC). AS security context mismatch prevents UE-gNB communication on the target cell; handover fails or UE/gNB cannot verify ciphered messages, causing service interruption.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 07, 2026

Free5GC Access and Mobility Function (AMF) versions up to 1.4.3 fail to enforce 3GPP TS 33.501 §6.9.5.1 concurrent security procedure rules, allowing NAS Security Mode Command (SMC) to execute simultaneously with N2 handover procedures. This causes security context mismatches between the UE and network when SMC activates a new KAMF while N2 HandoverRequest carries Next Hop (NH) and Next Hop Chaining Counter (NCC) derived from the old KAMF, resulting in different KgNB key derivation at the target gNB and UE and breaking access stratum (AS) security integrity. Source code analysis confirms missing cross-procedure validation in SecurityMode() and handleHandoverRequiredMain() functions; packet evidence demonstrates Rule 2 violation (SMC initiated during ongoing N2 handover).

RemediationAI

No vendor-released patch identified at time of analysis. The package metadata indicates fixed version as 'None', confirming no official patch is available. Immediate remediation options are limited and must rely on compensating controls. Organizations operating Free5GC AMF in production should: (1) disable or defer N2 handover procedures when SMC must be executed by modifying FSM logic to queue SMC until N2 procedures complete, accepting increased latency during mobility events; (2) implement external handover orchestration that serializes SMC and N2 handover via application-layer logic outside the AMF, ensuring mutual exclusion at the cost of handover performance; (3) restrict concurrent UE registrations and handovers via subscriber policy enforcement to minimize trigger conditions, reducing service availability; or (4) immediately patch the source code by adding OnGoing checks in both SecurityMode() (check GetOnGoing for N2Handover before sending SMC) and handleHandoverRequiredMain() (check GetOnGoing for NAS SMC before setting N2 handover state). The recommended interim fix is to apply source-code patch adding conditional checks: in SecurityMode(), add if GetOnGoing(OnGoingProcedureN2Handover) then defer SMC; in handleHandoverRequiredMain(), add if GetOnGoing(OnGoingProcedureNASSecurity) then reject N2 handover initiation. Upstream fix requires contribution to the Free5GC project; monitor https://github.com/free5gc/free5gc for patches or fork and apply locally.

Affected VersionsENISA

Free5GC < 4.2.2

Affected Packages

go github.com/free5gc/amf no fix
euvd free5gc fix: 4.2.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Free5GC is an open-source 5G core network implementation. The vulnerability exists in the Access and Mobility Function (AMF), which manages UE mobility and security procedures in 5G networks. The AMF implements a finite state machine (FSM) for NAS-level security with an OnGoing state tracker (SetOnGoing/GetOnGoing) for tracking procedure status. The root cause is CWE-358 (Improperly Implemented Security Check for Standard): the AMF tracks OnGoingProcedureN2Handover state but does not cross-check with NAS SMC state before initiating either procedure. The vulnerability violates 3GPP TS 33.501 §6.9.5.1, which mandates: (1) AMF shall not initiate N2 procedures with new keying material if NAS SMC is ongoing, and (2) AMF shall not initiate NAS SMC if N2 procedures with new keying material are ongoing. The technical impact stems from the relationship between KAMF (master key in NAS) and KgNB (access stratum key): SMC activates a new KAMF, which changes the basis for NH/NCC derivation used in N2 HandoverRequest. Concurrent execution causes UE and target gNB to derive different KgNB values, breaking AS ciphering and integrity protection.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L

Primary rating from NVD · only source for this CVE.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
Low

Lifecycle Timeline

4
Severity Changed
Oct 14, 2026 - 20:23 NVD
LOW MEDIUM
CVSS changed
Oct 14, 2026 - 20:23 NVD
3.7 (LOW) 5.4 (MEDIUM)
Patch available
May 27, 2026 - 19:46 EUVD
CVE Published
May 07, 2026 - 01:56 nvd
LOW 3.7

DescriptionNVD

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: > 1. 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. > 2. 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():

go
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():

go
amfUe.SetOnGoing(sourceUe.Ran.AnType, &context.OnGoing{
    Procedure: context.OnGoingProcedureN2Handover,
})
// No check for ongoing SMC before setting N2

Packet Evidence (pcap available):

PacketTimeMessageDescription
#10.000sHandoverRequiredgNB_A requests handover
#180.002sHandoverRequestN2 started (NH/NCC included)
*(no response from gNB_B)*N2 ongoing
#282.062sRegistration requestUE re-registers (same SUPI)
#632.069sAuthentication request
#642.070sAuthentication response
#712.072sSecurity mode commandSMC 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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 97% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Low

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Related Vulnerabilities in Free5GC AMF Security Vulnerabilities

View all 2

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy