CVE-2026-41136: free5GC AMF Missing Default Case Vulnerability

MODERATE
Advisory Identifier: GHSA-r99v-75p9-xqm5
CVSS 5.3
CWE-440
Published
Advisory Summary

CVE-2026-41136 is a MODERATE (CVSS 5.3) missing default case vulnerability (CWE-440: Expected Behavior Violation) affecting free5GC AMF libraries in the Go ecosystem. The issue involves missing default case in content-type switch in httpuecontexttransfer. Remediation is available in the latest vendor maintenance releases.

CVE-2026-41136 at a Glance

CVE Identifier CVE-2026-41136
GHSA Identifier GHSA-r99v-75p9-xqm5
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-440: Expected Behavior Violation
Affected Product free5GC AMF
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-41136

To remediate this vulnerability, upgrade all affected 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.

github.com/free5gc/amf fixed: Latest secure release
Upgrade github.com/free5gc/amf to Latest secure release
Verify Direct and Transitive Dependencies

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-41136, inspect your project dependencies for free5GC AMF:

inspect dependencies for github.com/free5gc/amf

Analyze the terminal output to locate any version of 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-440: Expected Behavior Violation, where a feature, api, or function does not perform according to its specification. In 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

## Summary The `HTTPUEContextTransfer` handler in `internal/sbi/api_communication.go` does not include a `default` case in the `Content-Type` switch statement. When a request arrives with an unsupported `Content-Type`, the deserialization step is silently skipped, `err` remains `nil`, and the processor is invoked with a completely uninitialized `UeContextTransferRequest` object. ## Details In `internal/sbi/api_communication.go`, the `HTTPUEContextTransfer` function handles the `Content-Type` header with a switch statement that only covers `application/json` and `multipart/related`: ```go switch str[0] { case applicationjson: err = openapi.Deserialize(ueContextTransferRequest.JsonData, requestBody, contentType) case multipartrelate: err = openapi.Deserialize(&ueContextTransferRequest, requestBody, contentType) // no default case } if err != nil { // skipped entirely when Content-Type is unsupported c.JSON(http.StatusBadRequest, rsp) return } s.Processor().HandleUEContextTransferRequest(c, ueContextTransferRequest) ``` This is inconsistent with the two analogous handlers in the same file, `HTTPCreateUEContext` and `HTTPN1N2MessageTransfer`, which both correctly include a `default` branch: ```go default: err = fmt.Errorf("wrong content type") ``` The fix is simply to add the same `default` case to `HTTPUEContextTransfer`. ## PoC With a free5GC deployment running, send a POST request to the UE context transfer endpoint using any unsupported `Content-Type` (e.g. `text/plain`): ```bash curl -s -X POST "http://<AMF_IP>/namf-comm/v1/ue-contexts/<ueContextId>/transfer" \\ -H "Content-Type: text/plain" \\ -d '{"test":"data"}' \\ -i ``` **Expected (correct) behavior:** `400 Bad Request` from the SBI layer, rejecting the request due to unsupported Content-Type — consistent with `HTTPCreateUEContext`. **Actual (observed) behavior:** The SBI-layer error check is bypassed and the processor is reached with an empty request object, returning: ``` HTTP/1.1 400 Bad Request {"status": 400, "cause": "MANDATORY_IE_MISSING"} ``` The `MANDATORY_IE_MISSING` cause originates from the processor's internal validation, not from the SBI handler — confirming the processor was called with an uninitialized struct. ## Impact The endpoint is an inter-NF SBI API used during AMF-to-AMF UE context handover. It is not directly reachable from external UEs and requires access to the internal 5GC SBI network. The processor's secondary mandatory field validation prevents any unintended state modification, so there is no direct exploitability. However, the SBI handler layer is the intended first line of defense — relying on the processor to compensate for a missing input check increases fragility and violates defense in depth. Any future change to the processor's validation logic could inadvertently expose the system to processing completely empty request objects.

CVE-2026-41136 Affected 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-41136?
CVE-2026-41136 is a security vulnerability in free5GC AMF involving Missing default case in Content-Type switch in HTTPUEContextTransfer under CWE-440: Expected Behavior Violation.
Which free5GC AMF versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/free5gc/amf.
What version fixes CVE-2026-41136?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/free5gc/amf affected?
Yes, github.com/free5gc/amf is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-41136?
CVE-2026-41136 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-41136?
CVE-2026-41136 is classified under CWE-440: Expected Behavior Violation (A feature, API, or function does not perform according to its specification.).
How can I check Go dependencies for CVE-2026-41136?
Run the dependency tree command: 'inspect dependencies for github.com/free5gc/amf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r99v-75p9-xqm5",
  "modified" : "2026-04-27T16:34:26Z",
  "published" : "2026-04-22T19:54:54Z",
  "aliases" : [ "CVE-2026-41136" ],
  "summary" : "free5GC AMF: Missing default case in Content-Type switch in HTTPUEContextTransfer",
  "details" : "## Summary\n\nThe `HTTPUEContextTransfer` handler in `internal/sbi/api_communication.go` does not include a `default` case in the `Content-Type` switch statement. When a request arrives with an unsupported `Content-Type`, the deserialization step is silently skipped, `err` remains `nil`, and the processor is invoked with a completely uninitialized `UeContextTransferRequest` object.\n\n## Details\n\nIn `internal/sbi/api_communication.go`, the `HTTPUEContextTransfer` function handles the `Content-Type` header with a switch statement that only covers `application/json` and `multipart/related`:\n\n```go\nswitch str[0] {\ncase applicationjson:\n    err = openapi.Deserialize(ueContextTransferRequest.JsonData, requestBody, contentType)\ncase multipartrelate:\n    err = openapi.Deserialize(&ueContextTransferRequest, requestBody, contentType)\n// no default case\n}\n\nif err != nil {\n    // skipped entirely when Content-Type is unsupported\n    c.JSON(http.StatusBadRequest, rsp)\n    return\n}\n\ns.Processor().HandleUEContextTransferRequest(c, ueContextTransferRequest)\n```\n\nThis is inconsistent with the two analogous handlers in the same file, `HTTPCreateUEContext` and `HTTPN1N2MessageTransfer`, which both correctly include a `default` branch:\n\n```go\ndefault:\n    err = fmt.Errorf(\"wrong content type\")\n```\n\nThe fix is simply to add the same `default` case to `HTTPUEContextTransfer`.\n\n## PoC\n\nWith a free5GC deployment running, send a POST request to the UE context transfer endpoint using any unsupported `Content-Type` (e.g. `text/plain`):\n\n```bash\ncurl -s -X POST \"http://<AMF_IP>/namf-comm/v1/ue-contexts/<ueContextId>/transfer\" \\\\\n  -H \"Content-Type: text/plain\" \\\\\n  -d '{\"test\":\"data\"}' \\\\\n  -i\n```\n\n**Expected (correct) behavior:** `400 Bad Request` from the SBI layer, rejecting the request due to unsupported Content-Type — consistent with `HTTPCreateUEContext`.\n\n**Actual (observed) behavior:** The SBI-layer error check is bypassed and the processor is reached with an empty request object, returning:\n\n```\nHTTP/1.1 400 Bad Request\n{\"status\": 400, \"cause\": \"MANDATORY_IE_MISSING\"}\n```\n\nThe `MANDATORY_IE_MISSING` cause originates from the processor's internal validation, not from the SBI handler — confirming the processor was called with an uninitialized struct.\n\n## Impact\n\nThe endpoint is an inter-NF SBI API used during AMF-to-AMF UE context handover. It is not directly reachable from external UEs and requires access to the internal 5GC SBI network. The processor's secondary mandatory field validation prevents any unintended state modification, so there is no direct exploitability. However, the SBI handler layer is the intended first line of defense — relying on the processor to compensate for a missing input check increases fragility and violates defense in depth. Any future change to the processor's validation logic could inadvertently expose the system to processing completely empty request objects.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P"
  } ],
  "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-r99v-75p9-xqm5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41136"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/free5gc/amf/releases/tag/v1.4.3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/free5gc/free5gc"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-440" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-22T19:54:54Z",
    "nvd_published_at" : "2026-04-22T00:16:29Z"
  }
}