mediumOther

Telegram Desktop HTML Export Hidden JavaScript Exfiltration

First seen Sep 15, 2026 · Updated Sep 15, 2026

telegramhtml-injectiondata-exfiltrationclient-side-attackmessaging-appjavascript-injection

A flaw in Telegram Desktop allows a malicious actor to plant hidden JavaScript inside a chat message that persists into HTML export files. When a victim opens the exported HTML file in a web browser, the embedded script silently executes and can exfiltrate all messages contained in that file to an attacker-controlled destination.

Technical Analysis

The vulnerability stems from insufficient sanitization of message content (specifically link-button style messages) when Telegram Desktop renders conversations into HTML export files. An attacker-controlled bot or contact sends a crafted message containing hidden JavaScript payloads that appear benign within the Telegram client but survive the HTML export process unsanitized. Upon export, the victim's browser executes the embedded script when the HTML file is opened locally, allowing the script to traverse the DOM and copy all exported message content for exfiltration to a remote server. No CVE has been publicly assigned as of this report; the issue was disclosed by researchers at ExPatch on September 12, 2026. If exported chat logs contain API keys, credentials, or tool-use transcripts from AI agents or automation bots operating via Telegram (a common integration point for agent notification/control channels), this exfiltration technique could expose sensitive agent credentials or conversation histories, making it agent-relevant for organizations using Telegram bots to interface with LLM agents.

Affected Systems

Telegram Desktop application (Windows/macOS/Linux) HTML chat export feature; any browser used to open exported HTML files

Indicators of Compromise

  • No specific hashes, IPs, or domains disclosed in source reporting; IOC details pending full ExPatch technical writeup

Remediation Steps

  1. 1

    Update Telegram Desktop

    Apply the latest Telegram Desktop update once the vendor patches the HTML export sanitization flaw.

  2. 2

    Avoid opening untrusted HTML exports in browsers

    Do not open exported chat HTML files directly in a web browser, especially from chats involving unknown bots or contacts; use plain text export or view within a sandboxed environment.

  3. 3

    Sanitize before sharing

    If sharing exported chat logs, strip or inspect embedded script tags and link-button elements before distribution.

  4. 4

    Rotate exposed credentials

    If any API keys, tokens, or agent credentials were shared via Telegram and later exported, rotate them immediately as a precaution.

  5. 5

    Restrict bot interactions

    Limit which bots can message accounts used for agent orchestration or sensitive communications, and audit bot permissions regularly.

Industries Most Exposed

technologycross-industrymessaging/communications

Sources

Respond to this threat

Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.