
完整的容器化实验环境 + PoC,针对 TeamViewer 中查看器侧的整数溢出
CBitmapBuffer(CWE-190,CVSS 3.1 8.8,AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H,
已在 15.83 中修复,公告 TV-2026-1011,由 Omri Dar / Remedio 发现)。
一个恶意(或被攻陷的)远程主机向连接的查看器通告一个超大屏幕几何尺寸
(DisplayParams)。查看器使用 32 位算术来计算其解码表面的尺寸;乘积发生回绕,因此一个约 4.3 GB 的表面被“分配”为约 4 MB,而之后所有的边界检查仍然使用未截断的声明尺寸和步幅。
随后屏幕更新(无损 RLE 瓦片)被解码到分配区域末尾之外
→ 受控的堆溢出 → 查看器 DoS/RCE。
| # | 主张 | 证据(全部由本实验环境生成) |
|---|---|---|
| 1 | 构造函数发生回绕 | evidence/driver_vuln.log:intended=0x100400400 WRAPPED to 0x400400(实时,15.82.6) |
| 2 | TeamViewer 自身计算出回绕后的尺寸 | evidence/TV_vuln.log:CBitmapBuffer::CBitmapBuffer Failed to create buffer, width 32784, height 32784, buffer size 4195328 |
| 3 | RLE 瓦片解码器确定性地执行越界写入 | 保护页运行:故障恰好发生在 base + byteSize(frida_final_vuln.log:access violation accessing 0x7f84cc7f8000 = base+0x401000) |
| 4 | 查看器进程死亡(DoS) | evidence/TV_vuln.log:Process received fatal SIGSEGV + TeamViewer 自身的 .stack 转储 |
| 5 | 崩溃正是 CVE 写入指令 | evidence/crash_vuln_132819.stack:帧 TeamViewer[0x1475569] = xor dword [rax], r8d — 解码器的越界写入循环(0x01475569) |
| 6 | 15.83 已修复 | evidence/TV_fixed.log:Buffer too big: width 32784, height 32784, stride 131136, buffer size 4299162624 — 64 位尺寸、显式拒绝、无回绕、无越界 |
binaries/ teamviewer_15.82.6_amd64.deb (vulnerable), 15.83.3 (fixed), 14.7.48657 (legacy)
lab/ Containerfile, entrypoint, guard_alloc.c (guard-page malloc shim),
compose.yaml (attacker/victim nodes), bring-up & run scripts
poc/ poc_final.js — Frida trigger: wrap + guard-page OOB (deterministic fault address)
poc_dos.js — Frida variant, real-heap smear
driver.c — LD_PRELOAD trigger (no frida): real heap corruption → viewer death
driver_fixed.cpp — negative control on 15.83.3
research/ ROOT-CAUSE.md — annotated disassembly of the vulnerable ctor, the XOR-RLE decoder,
the fix diff (15.82.6 ↔ 15.83.3), binary layout notes
*.txt — raw disassembly dumps
evidence/ logs, crash dumps, screenshots captured during validation
tvgfxprimitives::CBitmapBuffer::CBitmapBuffer(const ColorFormat&, uint w, uint h, uint stride, const Dimensions&, deleter) @ 0x017af084
(ET_EXEC — 地址在加载时固定):
; per plane (stride-override branch):
0x017af288 mov eax, [rsp+0x40] ; arg5 (stride, from DisplayParams path)
0x017af28c mov [rbp+0x20], eax ; plane->stride (UN-truncated, 32-bit)
0x017af28f imul esi, r8d ; byteSize = stride * sheight ← 32-BIT WRAP
0x017af293 mov qword [rbp+8], rsi ; plane->byteSize (wrapped)
...
0x017af29f call 0x17ae66d ; allocate(byteSize) → WRAPPED size
DeCompress XOR-RLE 瓦片解码器 @ 0x014753ea — f(URect* rect, CBitmapBuffer* bb, u8* src, u8* end):
rect 仅针对声明的表面进行校验;像素写入为
xor dword [rax], pixel; rax += 4,行按 plane->stride 递增——从不针对
分配进行校验:
0x01475569 xor dword [rax], r8d ; ← the OOB write (appears in the crash stack)
0x0147556c dec r15d
0x0147556f add rax, 4
Wire 记录格式(重建后):run = [0x7693b09e][count:u32][pixel:u32],
literal = [pixel:u32] —— 通过 XOR 解码到目标行。
修复(15.83.3):位于 0x016ec3ca 的同一构造函数使用
imul rax, qword [stride](64 位)计算平面大小,并拒绝总计为 > 0x7fffffff
的总量("Buffer too big …" → 错误 400/4),此外还新增了 "Stride too small" 防护。
./run_poc.sh build # build vulnerable (15.82.6) + fixed (15.83.3) node images
./run_poc.sh vuln # → RESULT: PASS — wrap → OOB write → viewer killed (4 assertions)
./run_poc.sh fixed # → RESULT: PASS — 64-bit size, explicit rejection, no wrap/OOB
./run_poc.sh clean # remove lab containers
run_poc.sh vuln 在单个容器内端到端断言:
WRAPPED(0x100400400 → 0x400400),SIGSEGV,.stack 包含帧 0x1475569(越界写入指令)。run_poc.sh fixed 断言 TeamViewer 自身的防护机制以未回绕的
64 位大小(buffer size 4299162624)触发,并拒绝该几何参数。
用于交互式检查的 Frida 变体:poc/poc_final.js(在 base+byteSize 处确定性地触发
防护页错误)、poc/poc_dos.js、poc/sweep_dims.js。
cd lab && podman-compose up -d # attacker 172.28.111.10 ↔ victim 172.28.111.20
包含本次研究期间使用的 GUI 启动/自动化脚本(EULA 点击确认、partner-ID 连接、接受流程),以及 lab/image/guard_alloc.c(guard-page malloc shim)。
该 CVE 在真实环境中的投递方式是:恶意主机通过已建立的加密会话向 DisplayParams 和 tile 载荷提供数据。本实验在查看器进程内部驱动完全相同的代码路径(解密后的字节),这与 Remedio 在其演示中使用的技术相同(“主机侧 hook……驱动完全相同的路径”)。完整的协议级伪造主机(受害者的查看器通过直连 LAN TCP/5938 连接到运行 Dyngate 握手的攻击者端点)已在 research/AUDIT-NOTES.md 中作为未来工作勾勒;双节点实验容器和会话启动脚本已包含在内。
参见 research/AUDIT-NOTES.md —— 解码器家族清单(RLE_Decode128 colortable 路径、RLE_DecodeWithColTable、TileDecoder::ProcessProgressiveJpeg),以及一个特定性质:所有像素写入均为 XOR(差分破坏原语:重复应用 = 在不覆盖的情况下进行堆布局)。
python3 exploit/exploit.py 运行完整攻击链(退出码 1 表示已利用,0 表示安全)。