Containerized PoC lab for CVE-2026-111585, a TeamViewer CBitmapBuffer integer overflow leading to heap overflow, with Frida triggers and vulnerable/fixed differential evidence.
Complete containerized lab + PoC for the viewer-side integer overflow in 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,
fixed in 15.83, bulletin TV-2026-1011, found by Omri Dar / Remedio).
A malicious (or compromised) remote host announces an oversized screen geometry
(DisplayParams) to a connecting viewer. The viewer sizes its decode surface with
32-bit arithmetic; the product wraps, so a ~4.3 GB surface is "allocated" as ~4 MB while
every later bounds check still uses the un-truncated declared dimensions and stride.
Screen updates (lossless RLE tiles) are then decoded past the end of the allocation
→ controlled heap overflow → viewer DoS/RCE.
| # | Claim | Evidence (all generated by this lab) |
|---|---|---|
| 1 | The constructor wraps | evidence/driver_vuln.log: intended=0x100400400 WRAPPED to 0x400400 (live, 15.82.6) |
| 2 | TeamViewer itself computes the wrapped size | evidence/TV_vuln.log: CBitmapBuffer::CBitmapBuffer Failed to create buffer, width 32784, height 32784, buffer size 4195328 |
| 3 | The RLE tile decoder writes OOB, deterministically | guard-page run: fault exactly at base + byteSize (frida_final_vuln.log: access violation accessing 0x7f84cc7f8000 = base+0x401000) |
| 4 | Viewer process dies (DoS) | evidence/TV_vuln.log: Process received fatal SIGSEGV + TeamViewer's own .stack dump |
| 5 | The crash IS the CVE write instruction | evidence/crash_vuln_132819.stack: frame TeamViewer[0x1475569] = xor dword [rax], r8d — the decoder's OOB write loop (0x01475569) |
| 6 | 15.83 is fixed | evidence/TV_fixed.log: Buffer too big: width 32784, height 32784, stride 131136, buffer size 4299162624 — 64-bit size, explicit rejection, no wrap, no OOB |
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 — addresses are load-time fixed):
; 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 tile decoder @ 0x014753ea — f(URect* rect, CBitmapBuffer* bb, u8* src, u8* end):
rect is validated against the declared surface only; pixel writes are
xor dword [rax], pixel; rax += 4 and rows advance by plane->stride — never checked
against the allocation:
0x01475569 xor dword [rax], r8d ; ← the OOB write (appears in the crash stack)
0x0147556c dec r15d
0x0147556f add rax, 4
Wire record format (reconstructed): run = [0x7693b09e][count:u32][pixel:u32],
literal = [pixel:u32] — decoded by XOR into the destination rows.
Fix (15.83.3): same ctor at 0x016ec3ca computes the plane size with
imul rax, qword [stride] (64-bit) and rejects totals > 0x7fffffff
("Buffer too big …" → error 400/4), plus a new "Stride too small" guard.
./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 asserts, end-to-end inside one container:
WRAPPED (0x100400400 → 0x400400),SIGSEGV,.stack contains frame 0x1475569 (the OOB write instruction).run_poc.sh fixed asserts TeamViewer's own guard fires with the un-wrapped
64-bit size (buffer size 4299162624) and rejects the geometry.
Frida variants for interactive inspection: poc/poc_final.js (deterministic
guard-page fault at 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
Contains the GUI bring-up/automation scripts (EULA click-through, partner-ID
connect, accept flow) used during this research, plus lab/image/guard_alloc.c
(guard-page malloc shim).
The CVE's real-world delivery is a malicious host feeding DisplayParams
and tile payloads over an established, encrypted session. This lab drives the
identical code path inside the viewer process (post-decryption bytes), the
same technique Remedio used for their demo ("a host-side hook … drives the
identical path"). A full protocol-level fake host (victim's viewer connects
over direct LAN TCP/5938 to an attacker endpoint speaking the Dyngate
handshake) is sketched in research/AUDIT-NOTES.md as future work; the
two-node lab containers and session bring-up scripts are included.
See research/AUDIT-NOTES.md — decoder family inventory (RLE_Decode128
colortable path, RLE_DecodeWithColTable, TileDecoder::ProcessProgressiveJpeg),
and the specific property that all pixel writes are XOR (differential
corruption primitive: repeat-application = heap grooming without overwrite).
python3 exploit/exploit.py runs the full chain (exit 1 exploited, 0 safe).