As reported by The Hacker News, researchers at ExPatch disclosed a stored cross-site scripting (XSS) vulnerability in Telegram Desktop's HTML export feature that allowed bot-sent messages to embed hidden JavaScript in exported chat files. The flaw is a textbook example of why client-side data export mechanisms deserve the same security scrutiny as network-facing APIs.

Security Impact: As reported by The Hacker News, researchers at ExPatch disclosed a stored cross-site scripting (XSS) vulnerability in Telegram Desktop's HTML export feature that allowed bot-sent messages to embed hidden JavaScript in exported chat files.

Vulnerability Summary

CVENot assigned in the source report
SeverityHigh (assessed — no CVSS published)
Affected ProductTelegram Desktop (Windows, macOS, Linux) — versions prior to July 2026 fix
Root CauseInline keyboard button text written to HTML exports without character escaping
Patch StatusFixed by Telegram in July 2026; pre-fix HTML exports remain vulnerable
Active ExploitationNone reported by researchers or Telegram

Why This Matters More Than It Looks

The technical root cause — missing output encoding on bot button labels — is straightforward. What makes this flaw significant is the attack durability and reach. A single bot message forwarded into any group chat becomes a permanent latent payload. It can sit in chat history for months or years, waiting for someone to export the conversation and open the resulting HTML in a browser. No click is required beyond opening the file.

The vulnerability turns a trusted feature — Telegram's chat export, often used for legal discovery, compliance archives, or personal backups — into an exfiltration and content-manipulation vector.

Three aspects elevate this beyond a typical stored XSS:

Why This Matters More Than It Looks
Forward propagation: The bot need not be a chat participant. Any group member who forwards the booby-trapped message carries the payload into new conversations, creating organic spread.
Export-as-attack-surface: The script executes in a browser context outside Telegram's application sandbox, with access to the full DOM of the exported file — every message, sender, timestamp, and file path.
Content integrity attacks: Beyond data theft, the script could rewrite the exported page entirely, including altering message text, dates, or sender names. For organizations using HTML exports as evidentiary records, this undermines document integrity.

Who Is Most Exposed

The highest-risk populations are users who export Telegram chats for compliance, legal, or investigative purposes — including journalists, legal teams, corporate compliance officers, and law enforcement. These users are most likely to open exported HTML files in browsers and least likely to inspect the underlying source before viewing. Organizations that archive Telegram communications as part of recordkeeping obligations should treat all pre-July 2026 exports as potentially tainted.

Immediate Actions

  • Update Telegram Desktop on all endpoints to the latest version available on each platform.
  • Inventory existing HTML exports: Search file shares, email attachments, and local systems for .html files exported from Telegram before July 2026.
  • Scan before opening: Inspect suspect export files for <script> tags or onerror= handlers in button-label regions before rendering in a browser. A simple grep for script tags is a reasonable first-pass triage.
  • Open in isolation: If viewing legacy exports is necessary, open them in a disposable VM or a browser with network access disabled to prevent exfiltration callbacks.
  • Re-export critical archives from updated Telegram Desktop clients if the original chat is still accessible, replacing pre-fix HTML files.

Shield53 Recommendations

Defenders should treat this as a reminder that data-at-rest in exported formats is an often-ignored attack surface. Any application that serializes user-controlled content into HTML, CSV, or PDF files must apply context-appropriate output encoding to every field — not just the obvious ones. Button labels, metadata fields, and system-generated labels are frequently overlooked.

For enterprise environments where Telegram is used for business communications, we recommend:
  • Adding Telegram Desktop to endpoint patch management policies rather than relying on auto-update alone.
  • Establishing a verification step in any workflow that ingests Telegram HTML exports as evidence — including hash verification and source-code inspection.
  • Educating users that forwarded messages from bots can carry hidden payloads that activate outside the originating application's security controls.

Telegram's fix closes the injection vector going forward, but the legacy export problem is permanent — any HTML file generated before the patch can still execute embedded scripts. That is the lasting lesson: once untrusted data is baked into a portable format, patches cannot recall it.