GHSA-r99v-75p9-xqm5
MEDIUMGHSA-r99v-75p9-xqm5 is a medium-severity (CVSS 5.3) remote code execution vulnerability in github.com/free5gc/amf. O3 Security confirms whether GHSA-r99v-75p9-xqm5 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
free5GC AMF: Missing default case in Content-Type switch in HTTPUEContextTransfer
Real-World Exposure
github.com/free5gc/amfReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
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:
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:
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):
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/free5gc/amf | all versions | No fix |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/free5gc/amf. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Remediation status
No patched version of github.com/free5gc/amf has shipped for GHSA-r99v-75p9-xqm5 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.
Mitigate without a patch
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-r99v-75p9-xqm5 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-r99v-75p9-xqm5. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-r99v-75p9-xqm5 in your dependencies?
O3 detects GHSA-r99v-75p9-xqm5 across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.