Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-102945 — CVE-2026-102945 的 PoC 与实验环境:NGAP Path Switch Request 中零长度的 UESecurityCapabilities BIT STRING 会导致 OMEC AMF 崩溃,包含存在漏洞/已修复的容器及利用脚本。 | Kitploit
工具/GitHubGitHub/googlesky/cve-2026-102945
漏洞利用网络安全论文与研究实验室与实践
GitHubgooglesky/cve-2026-102945

CVE-2026-102945

CVE-2026-102945 的 PoC 与实验环境:NGAP Path Switch Request 中零长度的 UESecurityCapabilities BIT STRING 会导致 OMEC AMF 崩溃,包含存在漏洞/已修复的容器及利用脚本。

查看仓库
1天前尚未审核
分享

CVE-2026-102945 — amf:空 UESecurityCapabilities 位串导致未恢复的 NGAP panic

License: MIT Research status: validated

CVECVE-2026-102945
组件OMEC amf — ngap/handler.go::HandlePathSwitchRequest(5G NGAP 路径切换处理)
受影响版本< 1.7.1-0.20260725031321-d28042aaaea0(已在 HEAD daed5a2 确认,v3.1.5 中存在)
修复于commit d28042aa(Guard against empty UESecurityCapabilities Bytes to avoid index panic,GHSA-v6w5-38cf-pcv8)
CWECWE-129(数组索引验证不当)、CWE-248(未捕获异常)
影响HandlePathSwitchRequest 仅检查 UESecurityCapabilities IE 是否存在,却从不检查其长度,而可扩展的 APER 类型会静默产生空位串。六处未加防护的 Bytes[0] 读取会在未恢复的 goroutine 上触发 panic,并终止 AMF 进程。AMF 是 5G 核心网的控制面入口,因此终止它会使所有用户的移动性管理中断
向量对端发送的 NGAP Path Switch Request,携带可扩展的零长度 UESecurityCapabilities BIT STRING
触发条件Path Switch Request 中 UESecurityCapabilities 存在但 Bytes 为空 → 六处 Bytes[0] 读取

存在漏洞的代码仅检查了 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
}

该修复至少需要两个字节,并依据其 CRITICALITY 忽略该 IE:

// 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. 根本原因

UESecurityCapabilities 被声明为可扩展的 APER BIT STRING (aper:"sizeExt,sizeLB:16,sizeUB:16")。当对端设置扩展位时, APER 解码器会丢弃 SIZE(16) 约束,并成功返回一个空的 Bytes 切片。处理程序唯一的防护是对包含该值的 IE 进行 nil 检查,因此全部六次 Bytes[0] 读取(三个加密标志和三个 完整性算法标志)都在零长度切片上执行。Go 会引发 runtime error: index out of range [0] with length 0;该 panic 在 NGAP 处理程序 goroutine 中未被 恢复,并终止整个 AMF。修复方案 检查两个位串是否满足 BIT STRING (SIZE(16,...)) 所要求的最小两字节; 由于该 IE 在 Path Switch Request 中具有 CRITICALITY IGNORE,短值会被记录并忽略,而不是被应用。

2. 复现环境

服务镜像角色
ps-vulncve-2026-102945:vuln来自 d28042aa^ 的上游代码块(存在漏洞),使用 Go 1.24 编译
ps-fixedcve-2026-102945:fixed来自 d28042aa 的上游代码块(已修复),使用 Go 1.24 编译
poccve-2026-102945-poc:local仅使用标准库的 Python 驱动程序

处理程序代码块在对应的两个提交处从 ngap/handler.go 逐字复制; 仅提供了最小桩代码(APER 位串、能力设置器、ran.Log)。 该处理程序被编译成一个二进制文件,作为 HTTP 服务的子进程运行,因此 panic 会以退出码和 Go 堆栈 跟踪的形式被观察到,而不会导致服务崩溃。输入模式:empty(扩展 位 → 零长度 Bytes)和 valid(两个字节,正常解码)。

3. 运行环境

./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. PoC

poc/poc.py(仅使用标准库):

  • check — 当零长度位串导致子进程以 Go index out of range panic 非零退出时返回 1;当短 IE 被警告并忽略时返回 0;3 表示无 worker,2 表示不可达/不确定。
  • exploit — 叙述式攻击链:扩展位 → 空位串 → 仅存在性检查 → 六次 Bytes[0] 读取 → 未恢复的 panic → 5G 核心网移动性管理丢失。
  • probe — 同时支持 empty 和 valid 两种模式,输出退出码、panic 标志和 stderr 片段(valid 用例证明该修复并非无效)。
  • mitigation — 在 d28042aa / len(Bytes) >= 2 / CRITICALITY IGNORE 之后执行。

一个独立的完整攻击链利用程序位于 exploit/exploit.py:

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

5. 预期结果

位串ps-vuln (d28042aa^)ps-fixed (d28042aa)
空(Bytes 零长度)子进程退出码 2 — panic: index out of range [0] with length 0退出码 0 — WARN: ... bit string too short ... ignoring IE
有效(2 字节)退出码 0,EA1..IA3 = 1退出码 0,EA1..IA3 = 1

捕获的运行记录: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. 环境前提条件

  • Podman(或 Docker);在隔离的 cve102945lab 网络上运行的有界容器;实验镜像中装有 Go 1.24 工具链。
  • 真实环境利用需要一个 NGAP 对端,能够向 AMF 的 SCTP 监听端口发送携带可扩展、零长度 UESecurityCapabilities BIT STRING 的 Path Switch Request。

7. 额外发现(针对修复后代码行的 0-day 排查)

上游防护检查同时检查 NRencryptionAlgorithms 和 NRintegrityProtectionAlgorithms 两个位串,通过一次长度检查覆盖了全部六处索引零读取。 valid 输入在两个构建上都将 EA1..IA3 设为 1, 确认该修复不会禁用合法的能力解码。 本次排查未发现具有相同“仅检查存在性”防护的同类路径。

8. 仓库结构

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. 参考资料

  • CVE 记录 — https://www.cve.org/CVERecord?id=CVE-2026-102945
  • GitHub 安全公告 — https://github.com/omec-project/amf/security/advisories/GHSA-v6w5-38cf-pcv8
  • 修复提交 — https://github.com/omec-project/amf/commit/d28042aaaea0221c5ea93c3e069a1dd5e7436f4c
  • 受影响的源代码 — ngap/handler.go,第 3267–3274 行(修复前)
下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    905
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    881
  • 3

    wifit3

    derv82/wifit3

    Wifite 但仅限 USB 且跨平台。

    673
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer是一个开源的特权访问管理(PAM)平台,为DevOps和IT团队提供通过Web浏览器按需安全访问SSH、RDP、Kubernetes、数据库和RemoteApp端点的能力。

    454
  • 5

    SafeLine

    chaitin/safeline

    自托管WAF和反向代理,可过滤恶意HTTP流量、阻止SQL注入、XSS和机器人攻击,具备速率限制和动态HTML/JS加密功能。

    402
  • 6

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    397

探索所有工具

浏览我们的工具集合

查看所有工具 →