Security Researchers Uncover Critical Vulnerabilities Bypassing Telegram Android Widget Security Filters

The security architecture of Telegram for Android is currently under intense scrutiny following the discovery of significant vulnerabilities that allow malicious actors to bypass newly implemented security measures. Despite recent efforts by Telegram to harden its platform against remote code execution (RCE) via its interactive "widget" feature, security firm NebuSec has demonstrated that these protections can be circumvented, potentially exposing users to unauthorized code execution.
The core of the issue lies in the implementation of "widgets"—small, interactive JavaScript-based blocks embedded within chat messages. While these widgets are designed to operate within a strictly controlled sandbox, researchers have identified pathways that allow malicious code to escape this environment, thereby interacting with the host operating system in ways that were explicitly forbidden by the platform’s security protocols.
The Evolution of the Telegram Widget Vulnerability
The controversy began when Telegram introduced widgets, allowing bots to send interactive content directly into user conversations. While these widgets were intended to enrich the user experience, their reliance on JavaScript engines created a new attack surface. Within 48 hours of the feature’s broader deployment, a security researcher operating under the handle V12 posted a proof-of-concept video on social media, asserting that Telegram messages could be weaponized to execute arbitrary remote code on target devices.
In response to these initial reports, Telegram developers moved quickly to implement defensive measures. The company introduced a sandboxing layer using QuickJS, a lightweight JavaScript engine, and encapsulated it within a separate, isolated process on Android devices. Furthermore, the developers integrated a seccomp (secure computing) filter. This kernel-level security feature is designed to restrict the system calls that a process can make, effectively limiting the "surface area" of the application and preventing the engine from performing sensitive actions like unauthorized file access, network communication, or process spawning.
However, the effectiveness of these measures has been called into question by the recent technical analysis published by NebuSec. The researchers demonstrated two distinct methods to bypass these protections: one involving a vulnerability within the widget engine itself that the seccomp filter does not address, and another that involves "chaining" a widget flaw with a pre-existing kernel-level vulnerability. During their demonstration, the researchers successfully forced the Telegram Android app (version 13.2.2, build 7303) to launch the device’s native calculator app, a hallmark proof-of-concept for RCE.
Technical Analysis of the Security Sandbox
To understand the severity of the situation, it is necessary to examine how the Telegram widget environment operates. According to official documentation, widgets are governed by a strict set of rules, including the prohibition of network access. These restrictions are enforced primarily at the software level within the JavaScript engine.

NebuSec’s findings highlight a fundamental flaw in this approach: if a vulnerability such as a "use-after-free" or "out-of-bounds write" exists within the QuickJS engine, a malicious script can manipulate the process’s memory. Once an attacker has control over the memory space, the software-defined sandbox rules become ineffective, as the underlying engine no longer dictates the script’s behavior.
The seccomp filter implemented by Telegram was intended to serve as a secondary line of defense. By explicitly listing allowed system calls—such as ptrace, bpf, and mount—the developers sought to restrict what a compromised widget could do. However, the filter’s source code revealed that certain system calls, including ioctl, remained unfiltered. In the context of Android security, ioctl (input/output control) is a broad and powerful system call that can be used to communicate with device drivers. If not properly restricted, it provides an attacker with a powerful primitive to escalate privileges or interact with hardware components beyond the scope of the original application permissions.
Furthermore, the implementation appears to be in an "audit mode" rather than a strict enforcement mode. The published source code for the Android version 13.2.2 contains a comment explicitly noting that the filter will remain in audit mode until logs confirm that the engine does not require the blocked system calls. In this state, while the system records prohibited activity, it may not effectively block all malicious attempts to initiate new processes, leaving a window of opportunity for sophisticated exploits.
Chronology of Events and Escalation
The timeline of these security developments suggests a rapid cycle of feature deployment followed by reactive security patching:
- Initial Deployment: Telegram enables interactive widgets for bots.
- Discovery: V12 exposes potential remote code execution capabilities via widgets.
- Mitigation: Telegram releases updates to the Android client (13.2.2), introducing the QuickJS engine isolation and seccomp filtering.
- Bypass Demonstration: NebuSec publishes research detailing how the new filters fail to contain malicious scripts.
- Independent Confirmation: Security firm Kaspersky reports the detection of "WebRAT" (or Salat Stealer) malware, which appears to be exploiting vulnerabilities in Telegram widgets to download malicious payloads and compromise user data, including crypto wallet keys and account tokens.
The involvement of real-world malware like WebRAT underscores that this is not merely a theoretical exercise. While the researchers’ demonstration of a calculator app may seem benign, the underlying exploit primitives are identical to those required to deploy sophisticated information-stealing software.
Official Responses and Industry Context
Telegram’s leadership has been active in downplaying the severity of the threat. CEO Pavel Durov issued a public statement maintaining that the platform is secure, emphasizing that a user must actively interact with a third-party bot before any code execution could occur. Durov’s stance suggests that the platform views these vulnerabilities as requiring a specific chain of user actions, rather than an "instant" exploit that could trigger upon the mere receipt of a message.
However, the cybersecurity community remains cautious. The fact that the widget environment is shared across all bots—meaning a single compromised widget could theoretically impact the entire sandbox environment—poses a systemic risk. If a malicious actor manages to gain a foothold, they would be operating within the same memory space used by other bots, potentially facilitating cross-bot contamination.

The lack of a dedicated Common Vulnerabilities and Exposures (CVE) identifier for these specific flaws has caused concern among security analysts. When vulnerabilities remain unassigned and undocumented in formal repositories, it becomes difficult for security teams at other organizations to track the threat or implement defensive measures across enterprise environments.
Broader Implications for Messaging Security
The events surrounding the Telegram widget vulnerabilities highlight the inherent tension between feature-rich user experiences and the security of the underlying platform. As messaging applications evolve into "super-apps" that incorporate mini-programs, bots, and interactive media, the complexity of the attack surface grows exponentially.
The reliance on JavaScript engines—while efficient for cross-platform development—introduces a class of memory-safety issues that have plagued browsers for decades. By importing this complexity into a mobile messaging environment, developers are essentially creating a mini-browser within the app, inheriting all the security challenges associated with web-based exploits.
The case of the WebRAT malware demonstrates that the threat is no longer confined to experimental research. Users who rely on Telegram for sensitive communications or financial transactions are now effectively participating in an ongoing security experiment. Until Telegram moves the seccomp filter out of "audit mode" and into a fully restrictive state, and until the reported memory-management vulnerabilities are addressed, the platform remains at a heightened risk level.
For the average user, the implications are clear: the principle of least privilege should be applied to interactions with third-party bots. Users are advised to avoid interacting with widgets from unknown or unverified sources and to keep their application updated to the latest available version, as further patches are expected to address the gaps identified by the security research community. As the industry continues to monitor the situation, the episode serves as a sobering reminder that even the most popular communication tools are subject to the fundamental laws of software security, where complexity remains the primary enemy of safety.







