CVE-2026-42081: Github.com/free5gc/amf Free5GC AMF Bypasses UE Security Vulnerability
MODERATECVE-2026-42081 is a MODERATE (CVSS 6.1) free5gc amf bypasses ue security vulnerability (CWE-358: Improperly Implemented Security Check for Standard) affecting Github.com/free5gc/amf libraries in the Go ecosystem. The issue involves free5gc amf bypasses ue security capabilities on ngap pathswitchrequest. Remediation is available in the latest vendor maintenance releases.
CVE-2026-42081 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:L).
How to Fix CVE-2026-42081
To remediate this vulnerability, upgrade all affected Github.com/free5gc/amf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/free5gc/amf to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/free5gc/amf
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-42081, inspect your project dependencies for Github.com/free5gc/amf:
inspect dependencies for github.com/free5gc/amf
Analyze the terminal output to locate any version of Github.com/free5gc/amf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-358: Improperly Implemented Security Check for Standard, where the product does not implement or incorrectly implements one or more security-relevant checks as specified by the design of a standardized algorithm, protocol, or technique. In Github.com/free5gc/amf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-42081 Affected Github.com/free5gc/amf Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/free5gc/amf
|
Go |
≤ 1.4.3
|
|
References
Frequently Asked Questions
What is CVE-2026-42081?
Which Github.com/free5gc/amf versions are affected?
What version fixes CVE-2026-42081?
Is github.com/free5gc/amf affected?
What is the CVSS score of CVE-2026-42081?
What CWE is associated with CVE-2026-42081?
How can I check Go dependencies for CVE-2026-42081?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-77x9-rf64-92gv",
"modified" : "2026-06-08T23:46:37Z",
"published" : "2026-05-07T01:53:47Z",
"aliases" : [ "CVE-2026-42081" ],
"summary" : "Free5GC AMF Bypasses UE Security Capabilities on NGAP PathSwitchRequest",
"details" : "### Summary\nThe AMF in Free5GC v4.2.1 does not verify the UE Security Capabilities received in NGAP PathSwitchRequest messages against its locally stored values, as mandated by 3GPP TS 33.501 §6.7.3.1. A malicious gNB can overwrite the AMF's stored UE security capabilities with arbitrary values, which are then propagated in PathSwitchRequest Acknowledge messages and subsequent Handover Request messages. This leads to persistent handover denial-of-service for affected UEs.\n\n### Details\n**Affected File:** `amf/internal/ngap/handler.go` — `handlePathSwitchRequestMain` function\n\n**Root Cause:**\n\nWhen the AMF receives a PathSwitchRequest during an Xn-handover, it processes the UESecurityCapabilities IE by directly overwriting the stored values without comparing them to the previously stored capabilities:\n\n```go\nif uESecurityCapabilities != nil {\n amfUe.UESecurityCapability.SetEA1_128_5G(uESecurityCapabilities.NRencryptionAlgorithms.Value.Bytes[0] & 0x80)\n amfUe.UESecurityCapability.SetEA2_128_5G(uESecurityCapabilities.NRencryptionAlgorithms.Value.Bytes[0] & 0x40)\n amfUe.UESecurityCapability.SetEA3_128_5G(uESecurityCapabilities.NRencryptionAlgorithms.Value.Bytes[0] & 0x20)\n amfUe.UESecurityCapability.SetIA1_128_5G(uESecurityCapabilities.NRintegrityProtectionAlgorithms.Value.Bytes[0] & 0x80)\n amfUe.UESecurityCapability.SetIA2_128_5G(uESecurityCapabilities.NRintegrityProtectionAlgorithms.Value.Bytes[0] & 0x40)\n amfUe.UESecurityCapability.SetIA3_128_5G(uESecurityCapabilities.NRintegrityProtectionAlgorithms.Value.Bytes[0] & 0x20)\n}\n```\n\n**3GPP TS 33.501 §6.7.3.1 requires three actions, none of which are implemented:**\n\n1. **Verification (SHALL):** \"The AMF shall verify that the UE's 5G security capabilities received from the target gNB/ng-eNB are the same as the UE's 5G security capabilities that the AMF has locally stored.\"\n → Not implemented. The AMF unconditionally overwrites stored values.\n\n2. **Correction (SHALL):** \"If there is a mismatch, the AMF shall send its locally stored 5G security capabilities of the UE to the target gNB/ng-eNB in the Path-Switch Acknowledge message.\"\n → Not implemented. The PathSwitchRequestAcknowledge contains the corrupted values.\n\n3. **Logging (SHALL):** \"The AMF shall support logging capabilities for this event and may take additional measures, such as raising an alarm.\"\n → Not implemented. No mismatch detection or logging exists.\n\n**Propagation:**\n\nThe corrupted values are propagated in:\n- **PathSwitchRequestAcknowledge:** Contains corrupted UESecurityCapabilities (demonstrated in pcap)\n- **Subsequent HandoverRequest messages:** AMF sends corrupted capabilities to target gNBs\n\nPer TS 38.413 §8.4.2.4, if the supported algorithms in the UE Security Capabilities do not match any allowed algorithms configured in the target gNB, the target gNB is required to reject the procedure using a HANDOVER FAILURE message.\n\n### PoC\n**Environment:**\n- Free5GC v4.2.1 AMF (Docker container) with full NF stack (NRF, AUSF, UDM, UDR, NSSF, PCF, SMF, UPF)\n- UERANSIM v3.2.7 gNB with custom inspection-tool extension\n- tshark for packet capture\n\n**Reproduction Steps:**\n\n1. Start Free5GC full stack and register a UE through a gNB (NG Setup → Registration → PDU Session Setup).\n\n2. Send a normal HandoverRequired from the gNB. Capture the resulting HandoverRequest from the AMF and confirm `nRintegrityProtectionAlgorithms = 0xe000` (NIA1, NIA2, NIA3 all supported). This is the baseline.\n\n3. Send a PathSwitchRequest with `nRintegrityProtectionAlgorithms = 0x0000` (all integrity algorithms set to not supported). The AMF responds with PathSwitchRequestAcknowledge.\n\n4. Observe that the PathSwitchRequestAcknowledge contains `nRintegrityProtectionAlgorithms = 0x0000` — the corrupted values are propagated back.\n\n**Observed Result (from pcap capture):**\n\n| Packet | Message | nRintegrityProtectionAlgorithms |\n|--------|---------|-------------------------------|\n| #20 | HandoverRequest (AMF→gNB) | `0xe000` (NIA1 ✓ NIA2 ✓ NIA3 ✓) — **baseline** |\n| #30 | PathSwitchRequest (gNB→AMF) | `0x0000` — **poison** |\n| #47 | PathSwitchRequestAcknowledge (AMF→gNB) | `0x0000` (NIA1 ✗ NIA2 ✗ NIA3 ✗) — **corrupted** |\n\n### Impact\n**Availability (HIGH):** A malicious gNB can send a single PathSwitchRequest message to corrupt the AMF's stored UE security capabilities for any UE. All subsequent inter-gNB handovers for the affected UE are expected to fail (per TS 38.413 §8.4.2.4), resulting in denial-of-service that persists until the UE performs a new registration.\n\n**Integrity (LOW):** The AMF's internal UE security context is corrupted with attacker-controlled values. These corrupted values are propagated to other network elements via PathSwitchRequestAcknowledge and HandoverRequest messages.\n\n**Who is impacted:** Any deployment using Free5GC as the AMF where a gNB could be compromised or where untrusted gNBs exist (e.g., O-RAN multi-vendor deployments).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/free5gc/amf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "1.4.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/free5gc/free5gc/security/advisories/GHSA-77x9-rf64-92gv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42081"
}, {
"type" : "WEB",
"url" : "https://github.com/free5gc/amf/blame/v1.4.3/internal/ngap/handler.go"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/free5gc/free5gc"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-358" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-07T01:53:47Z",
"nvd_published_at" : "2026-05-27T17:16:34Z"
}
}