Skip to content
KitploitKITPLOIT
ToolsBlog
Log in
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/googlesky/cve-2026-102945
ExploitationNetwork SecurityPapers & ResearchLabs & Practice
GitHubgooglesky/cve-2026-102945

CVE-2026-102945

PoC and lab for CVE-2026-102945: a zero-length UESecurityCapabilities BIT STRING in an NGAP Path Switch Request panics OMEC AMF, with vulnerable/fixed containers and exploit script.

View Repository
1 day agoNot yet reviewed
Share

CVE-2026-102945 — amf: unrecovered NGAP panic on an empty UESecurityCapabilities bit string

License: MIT Research status: validated

CVECVE-2026-102945
ComponentOMEC amf — ngap/handler.go::HandlePathSwitchRequest (5G NGAP path-switch handling)
Affected< 1.7.1-0.20260725031321-d28042aaaea0 (confirmed at HEAD daed5a2, present in v3.1.5)
Fixed incommit d28042aa (Guard against empty UESecurityCapabilities Bytes to avoid index panic, GHSA-v6w5-38cf-pcv8)
CWECWE-129 (Improper Validation of Array Index), CWE-248 (Uncaught Exception)
ImpactHandlePathSwitchRequest guards the UESecurityCapabilities IE for presence but never for length, and the extensible APER type silently yields an empty bit string. Six unguarded Bytes[0] reads panic on an unrecovered goroutine and terminate the AMF process. The AMF is the control-plane entry point for a 5G core, so terminating it drops mobility management for every subscriber
VectorA peer NGAP Path Switch Request carrying an extensible, zero-length UESecurityCapabilities BIT STRING
TriggerPath Switch Request with UESecurityCapabilities present but Bytes empty → six Bytes[0] reads

The vulnerable code checked only for nil:

// ngap/handler.go — pre-fix (line 3267)
if uESecurityCapabilities != nil {                                          // presence only
    amfUe.UESecurityCapability.SetEA1_128_5G((uESecurityCapabilities.NRencryptionAlgorithms.Value.Bytes[0] & 0x80) >> 7)
    ... // five more Bytes[0] reads
}

The fix requires at least two bytes and ignores the IE per its CRITICALITY:

// fixed (commit d28042aa)
if len(uESecurityCapabilities.NRencryptionAlgorithms.Value.Bytes) < 2 ||
    len(uESecurityCapabilities.NRintegrityProtectionAlgorithms.Value.Bytes) < 2 {
    ran.Log.Warnln("UESecurityCapabilities bit string too short ... ignoring IE ...")
} else {
    ... // the six original reads
}

1. Root cause

UESecurityCapabilities is declared with an extensible APER BIT STRING (aper:"sizeExt,sizeLB:16,sizeUB:16"). When a peer sets the extension bit, the APER decoder discards the SIZE(16) constraint and returns successfully with an empty Bytes slice. The handler's only guard was a nil check on the containing IE, so all six Bytes[0] reads (three encryption and three integrity algorithm flags) executed against a zero-length slice. Go raises runtime error: index out of range [0] with length 0; the panic is not recovered in the NGAP handler goroutine and terminates the whole AMF. The fix checks both bit strings for the minimum two bytes required by BIT STRING (SIZE(16,...)); because the IE has CRITICALITY IGNORE in a Path Switch Request, a short value is logged and ignored rather than applied.

2. Reproduction environment

serviceimagerole
ps-vulncve-2026-102945:vulnupstream block from d28042aa^ (vulnerable) compiled with Go 1.24
ps-fixedcve-2026-102945:fixedupstream block from d28042aa (fixed) compiled with Go 1.24
poccve-2026-102945-poc:localstdlib-only Python driver

The handler block is copied verbatim from ngap/handler.go at the two commits; only minimal stubs (APER bit strings, capability setters, ran.Log) are supplied. The handler is compiled into a binary that runs as a child of the HTTP service, so the panic is observed as an exit code and a Go stack trace rather than taking down the service. Input modes: empty (extension bit → zero-length Bytes) and valid (two bytes, normal decode).

3. Running the environment

./run-lab.sh build     # builds both sides (golang:1.24-alpine + python3)
./run-lab.sh up        # cve102945lab network: ps-vuln / ps-fixed
./run-lab.sh sweep
./run-lab.sh down

4. The PoC

poc/poc.py (stdlib only):

  • check — exit 1 when a zero-length bit string makes the child exit non-zero with a Go index out of range panic, 0 when the short IE is warned and ignored; 3 no worker, 2 unreachable/indeterminate.
  • exploit — narrated chain: extension bit → empty bit string → presence-only guard → six Bytes[0] reads → unrecovered panic → 5G core mobility management lost.
  • probe — both empty and valid modes with exit codes, panic flags and stderr snippets (the valid case proves the fix is not dead).
  • mitigation — post-d28042aa / len(Bytes) >= 2 / CRITICALITY IGNORE.

A standalone full-chain exploit ships at exploit/exploit.py:

python3 exploit/exploit.py --host=ps-vuln
# exit 1 on confirmed panic, 0 on a safe target

5. Expected results

bit stringps-vuln (d28042aa^)ps-fixed (d28042aa)
empty (Bytes zero-length)child exit 2 — panic: index out of range [0] with length 0exit 0 — WARN: ... bit string too short ... ignoring IE
valid (2 bytes)exit 0, EA1..IA3 = 1exit 0, EA1..IA3 = 1

Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt, evidence/probe-*-run.txt, evidence/mitigation-*-run.txt, evidence/exploit-standalone-run.txt, evidence/exploit-standalone-fixed-run.txt, evidence/versions.txt, evidence/upstream-*-block.txt, evidence/0day-sweep.txt.

6. Environment preconditions

  • Podman (or Docker); bounded containers on the isolated cve102945lab network; Go 1.24 toolchain in the lab images.
  • Real-world exploitation requires an NGAP peer able to send a Path Switch Request with an extensible, zero-length UESecurityCapabilities BIT STRING to the AMF's SCTP listener.

7. Additional findings (0-day sweep on the fixed line)

The upstream guard checks both NRencryptionAlgorithms and NRintegrityProtectionAlgorithms bit strings, covering all six index-zero reads with one length check. The valid input sets EA1..IA3 to 1 on both builds, confirming the fix does not disable legitimate capability decoding. No sibling path with the same presence-only guard was found in this sweep.

8. Repository layout

README.md                  this write-up
run-lab.sh                 environment driver (build / up / sweep / down)
Makefile                   convenience targets
poc/poc.py                 the PoC (check / exploit / probe / mitigation)
exploit/exploit.py         standalone full-chain exploit
lab/main-vuln.go           upstream vulnerable block + minimal stubs
lab/main-fixed.go          upstream fixed block + minimal stubs
lab/lab.Dockerfile         builds both sides from the Go sources
lab/service.py             HTTP wrapper (POST /run), child-process isolation
evidence/                  captured runs of every mode on both sides
TRACKING.md                excluded (working record)

9. References

  • CVE record — https://www.cve.org/CVERecord?id=CVE-2026-102945
  • GitHub advisory — https://github.com/omec-project/amf/security/advisories/GHSA-v6w5-38cf-pcv8
  • Fix commit — https://github.com/omec-project/amf/commit/d28042aaaea0221c5ea93c3e069a1dd5e7436f4c
  • Affected source — ngap/handler.go, lines 3267–3274 (pre-fix)
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    905
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    881
  • 3

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    673
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    454
  • 5

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    402
  • 6

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    397

Explore all tools

Browse our collection of tools

View all tools →