How Secure Is Telegram for Android Against Remote Hacks?

How Secure Is Telegram for Android Against Remote Hacks?

A simple incoming voice call on a smartphone, an action performed millions of times a day, recently transformed into a silent gateway for unauthorized remote access. Security researchers at the startup NebuSec identified a critical vulnerability within Telegram for Android that allows malicious actors to execute code on a victim’s device without leaving traditional traces. While Telegram has long marketed itself as a bastion of privacy and encrypted communication, this specific flaw exposes the underlying fragility inherent in complex mobile applications that handle real-time media streams. The vulnerability was not just a theoretical risk but a persistent logic error that remained unpatched for over two years, affecting numerous versions of the application. For a platform that boasts over 900 million active users, the discovery of a method to compromise a device through a standard call feature serves as a reminder that no software is entirely immune to sophisticated exploitation.

The Mechanics of Memory Corruption

Understanding the Technical Flaw: Logic Errors in MediaState

The root of the security issue lies within a specific protocol used by Telegram to manage “MediaState” messages during voice and video calls. These messages are essential for synchronizing the state of a call between two participants, such as indicating if a user has muted their microphone or rotated their camera. During the technical audit, researchers found that the code responsible for parsing these messages contained a critical logic error. Specifically, when the application processed a message containing video rotation data, it attempted to read a subsequent field—the video state—without verifying if that data actually existed. This oversight resulted in an out-of-bounds memory access, a condition where the software reads or writes to memory locations outside of its intended buffer. Such memory corruption bugs are highly sought after by exploit developers because they provide the initial foothold necessary to manipulate application behavior and execute unauthorized commands on target devices.

Navigating the Exploitation Chain: From Memory Access to Root Control

Gaining full control over a modern Android device requires more than just a single memory corruption bug; it necessitates a coordinated “exploit chain” to bypass various security layers. NebuSec explained that this initial Telegram vulnerability must be paired with an information-leak bug to effectively circumvent Address Space Layout Randomization (ASLR). ASLR is a standard defense mechanism that randomizes where data is stored in memory, making it difficult for an attacker to predict where to inject malicious code. Once ASLR is defeated, the attacker can “escape” the Telegram app’s sandbox, which is designed to prevent individual apps from accessing system files or other applications. However, the final step involves a root exploit, which elevates the attacker’s privileges to an administrative level. With root access achieved, a malicious actor could silently activate the device’s microphone and camera, effectively turning the smartphone into a pocket-sized surveillance tool.

Discrepancies in Platform Security

Analyzing Cross-Platform Patching: The Android Delay

One of the most concerning aspects of this vulnerability is the inconsistency with which patches were deployed across different operating systems. The flawed logic resided in a shared library known as tgcalls, which handles the heavy lifting for voice and video communications on Android, iOS, and desktop platforms. Records indicate that a fix for the camera rotation bug was committed to the core library as early as April 2024. However, the integration of this fix into the public versions of the Telegram apps happened at wildly different intervals. While iOS users received the security update in May and desktop users were protected by July, the Android version of Telegram remained vulnerable until late September. This months-long gap left Android users exposed to a known vulnerability that had already been addressed in other ecosystems. This delay highlights the logistical challenges of maintaining a unified security posture across multiple platforms when third-party libraries are involved in the stack.

Role of AI in Vulnerability Discovery: The NebuSec Methodology

The discovery of this exploit also sheds light on the evolving landscape of cybersecurity research, where artificial intelligence is playing an increasingly dominant role. NebuSec utilized an AI-driven security analysis tool, powered by a GPT-5.4 model, to identify the subtle memory-corruption errors that had gone unnoticed by traditional automated testing and human developers for years. This approach allowed the researchers to simulate millions of interactions and edge cases, eventually uncovering the specific sequence of MediaState signals required to trigger the crash. The use of advanced language models in code auditing represents a paradigm shift, as these tools can understand the context of code and identify logic flaws that do not necessarily violate simple syntax rules. Although Telegram disputed the researchers’ claims regarding the severity of the exploit, the demonstration of a compromised device during a live call proved that AI-assisted vulnerability hunting is a formidable force today.

Proactive Defense for Mobile Users

Immediate Mitigation Strategies: Practical Steps for Protection

For individuals concerned about the potential for remote exploitation, the most critical step is ensuring that the Telegram application is updated to version 12.10.4 or higher immediately. This version contains the essential patches for the tgcalls library and resolves the out-of-bounds memory access issue discovered by researchers. Beyond software updates, users can take advantage of Telegram’s granular privacy settings to significantly shrink their attack surface. Since the exploit requires the victim to answer an incoming call to trigger the memory corruption, restricting who can initiate calls provides an effective barrier. By setting the “Who can call me” option to “My Contacts” or even “Nobody” in the privacy and security menu, users can prevent unsolicited calls from potential attackers. These behavioral changes are often more effective than technical solutions alone because they address the human element of the connection process, ensuring only trusted individuals engage with the device.

Future Architectural Enhancements: Migrating to Memory-Safe Languages

The broader response to these vulnerabilities involved a strategic shift in the programming languages used to build core application components. To address the inherent risks of C++, which required manual memory management and was prone to the types of errors seen in this exploit, Telegram began transitioning its Android and desktop libraries to Rust. Specifically, the replacement of the rlottie library with a Rust-based alternative called tlottie demonstrated a commitment to memory-safe architectures. Rust was designed to prevent memory-related bugs at the compile level, making entire classes of vulnerabilities like buffer overflows and out-of-bounds access virtually impossible. This transition represented a fundamental change in how the platform approached security engineering, moving away from reactive patching and toward a more resilient foundation. By adopting these modern development standards, the platform creators sought to eliminate the technical debt that led to failures and provided a roadmap for building secure tools.

Subscribe to our weekly news digest.

Join now and become a part of our fast-growing community.

Invalid Email Address
Thanks for Subscribing!
We'll be sending you our best soon!
Something went wrong, please try again later