Skip to content
RCE Write-up Beginner

Typo Trouble Exploring The Telegram Python Rce Vulnerability

A typo in Telegram Desktop's list of dangerous file extensions meant that .pyzw Python zip applications were not recognised as hazardous, so they opened automatically when a user clicked them. An attacker could send such a file disguised as a video and, if Python was installed, run arbitrary code on the victim's Windows machine.

JustAnother-Engineer Follow

Published on infosecwriteups.com

Telegram’s Windows application was recently updated to address a critical zero-day flaw that permitted the execution of Python scripts without triggering security alerts, due to a typo in processing certain file extensions.

JustAnother-Engineer, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

A misspelled file extension ('pywz' instead of 'pyzw') in Telegram Desktop's dangerous-extension list meant .pyzw files were treated as safe and opened automatically.

Impact

An attacker could execute arbitrary commands on a victim's Windows machine if the victim clicked a malicious .pyzw file and Python was installed; Telegram deployed a server-side mitigation that tags such files as untrusted, requiring user confirmation.

What the attacker needed

Victim uses Telegram Desktop on Windows; Python is installed on the victim's device; Victim clicks the sent file

The fix

Telegram deployed a server-side fix that appends '.untrusted' to .pyzw files so users must confirm before running them, and corrected the typo in the desktop app for future updates.

How it was found

  1. Create a Python zip application (.pyzw) that opens a command prompt when run.
  2. Send the file to the victim through Telegram.
  3. The victim clicks the file message, and because of the typo the security warning is bypassed and the command runs.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Telegram keeps a list of file types it considers dangerous, like programs, and warns you before opening them. Because of a spelling mistake in that list, a type of Python program file was not on it, so Telegram let Windows open it straight away when clicked. If the victim had Python installed, that program could run commands on their computer.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by JustAnother-Engineer

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.