Cybersecurity

Telegram Security Sandbox Bypassed by Malicious Widgets Despite Recent Hardening Efforts

The security architecture of the Telegram Android application is facing renewed scrutiny following a technical disclosure by the security research firm NebuSec. The findings indicate that the protective measures recently implemented by Telegram to isolate "widgets"—interactive, JavaScript-based blocks embedded within chat messages—are insufficient to prevent malicious code execution. This revelation challenges the efficacy of the platform’s recent attempt to secure its widget engine through process isolation and system call filtering, casting doubt on the safety of the feature as it currently exists on the Android platform.

A Chronology of the Vulnerability

The controversy began last week when Telegram introduced the ability for bots to send interactive widgets to users. Shortly thereafter, on October 24, a security researcher operating under the handle "V12" posted a video on the social media platform X, claiming that any message sent via Telegram could be leveraged to execute remote code on a victim’s device.

In a rapid response to these claims, Telegram updated its Android application to version 13.2.2 (7303). The update introduced two significant hardening layers: the migration of the QuickJS engine—which processes the widget’s JavaScript—into a dedicated, isolated process, and the implementation of a seccomp (secure computing) filter. The filter was designed to restrict the process from making sensitive system calls, effectively attempting to lock the JavaScript execution within a strictly defined sandbox.

However, NebuSec’s technical analysis, released only days later, suggests that these countermeasures were bypassed. The researchers demonstrated two distinct methods for escaping the sandbox. The first involves exploiting a vulnerability within the widget engine that the current seccomp filter does not adequately address. The second method involves "chaining"—using a minor widget bug to facilitate a more severe kernel-level exploit, thereby circumventing the filter entirely. The researchers provided video evidence showing that a malicious widget could bypass these protections to trigger a calculator application on the host device, signaling that the sandbox is not as impermeable as intended.

Technical Analysis of the Security Flaw

The core of the issue lies in how Telegram handles the execution environment for third-party scripts. According to documentation, widgets are intended to run in a highly restricted sandbox that prohibits network access and limits access to system resources. NebuSec researchers argue that these rules are enforced within the engine’s own code, rather than by a robust, hardware-backed isolation layer.

Researchers Claim Two RCE Exploits That Bypass Telegram’s New Android Defenses

When a vulnerability—such as a "use-after-free" or "out-of-bounds write"—is identified within the QuickJS engine, a malicious actor can effectively gain read and write privileges over the process memory. Once this access is achieved, the internal rules of the engine become moot. The current seccomp filter, while intended to provide a secondary line of defense, appears to have significant gaps. An inspection of the filter’s source code reveals that it explicitly leaves the ioctl system call unfiltered. ioctl is a versatile system call often used to communicate with device drivers, and in many security contexts, it is considered a significant attack vector for escalating privileges from a restricted user-space process to the kernel.

See also  Critical Click2Shell Vulnerability Discovered in WordPress Core Demands Immediate Security Patching

Furthermore, the researchers identified a architectural flaw: all widgets, regardless of which bot sends them, are executed within the same process. This means that a vulnerability in a single widget could lead to the cross-contamination of data between multiple bots, or worse, expose user data that the engine is supposed to be protecting.

Audit Mode and the State of Production Code

The situation is further complicated by the configuration of the security filter in the public release of the Telegram Android app. A code review by The Hacker News of the source for version 13.2.2 (7303) revealed that the seccomp filter is currently operating in "audit mode." In this state, the filter does not actively block most suspicious system calls; instead, it logs them while allowing them to proceed. A comment within the source code suggests that this was a temporary measure intended to remain in place only until developers were confident that the engine would not trigger false positives during standard operation.

It remains unclear whether the version of the application currently available on the Google Play Store is running with this audit-only configuration or if a silent update has moved the filter into a more restrictive "enforcement" mode. Telegram’s own official documentation and bot API contributors have noted that, as of this week, general access to the widget feature is highly restricted, with many bots still barred from utilizing the functionality in private chats. This suggests that the platform is still in an experimental or "soft-launch" phase, despite the feature being active in the codebase.

Official Responses and Conflicting Reports

The leadership at Telegram has maintained a firm stance regarding the safety of the application. CEO Pavel Durov publicly addressed the concerns in a channel post, asserting that the platform is secure and that the reports of remote code execution were exaggerated. Durov emphasized that a user would need to take the explicit action of starting a third-party service or interacting with a bot before any potential exploit could occur. He further claimed that any vulnerabilities related to the initial reports had been patched on the server side, suggesting that the risk to the average user is negligible.

However, the cybersecurity industry remains wary. The security firm Kaspersky issued a warning late last week, stating that they had detected active exploitation of a flaw within Telegram widgets. The malicious activity involved the deployment of "WebRAT," also known as "Salat Stealer." This malware is designed to harvest sensitive information, including cryptocurrency wallet credentials and Telegram account session data. The infection chain observed by Kaspersky involves the automatic execution of a PowerShell script, which subsequently downloads and installs the malicious payload without the user’s explicit consent. While Kaspersky did not definitively link their findings to the specific bugs identified by NebuSec, the existence of active in-the-wild exploitation underscores the reality that the widget ecosystem is currently being targeted by threat actors.

See also  Nelnet Servicing Data Breach Compromises Personal Information of 2.5 Million Student Loan Borrowers
Researchers Claim Two RCE Exploits That Bypass Telegram’s New Android Defenses

Broader Implications for Mobile Security

The Telegram widget incident highlights a recurring challenge in modern software development: the tension between feature-rich user experiences and the necessity of robust security sandboxing. By allowing third-party JavaScript to execute on a user’s device, Telegram has expanded its attack surface significantly. While the use of Web-based technologies (like JavaScript engines) is common in modern apps, the complexity of securing these environments against sophisticated exploits—especially when those exploits target kernel-level vulnerabilities—is immense.

The reliance on seccomp filters is a recognized best practice, but it is not a silver bullet. If a filter is too permissive, it fails to stop attackers; if it is too restrictive, it breaks the functionality of the application. The current reliance on "audit mode" suggests that Telegram is prioritizing app stability over aggressive security enforcement, a decision that has clearly left a window of opportunity for attackers.

For the average Telegram user, the incident serves as a reminder to exercise caution when interacting with bots. Although the platform is working toward a more secure implementation, the current state of the widget engine suggests that users should avoid interacting with widgets from untrusted or unknown bots. Security professionals are also calling for more transparency from Telegram, urging the company to release a formal CVE (Common Vulnerabilities and Exposures) identifier for these bugs to allow for better tracking and patch management.

As of the latest reports, Telegram has not released a definitive statement confirming the resolution of the specific bypasses demonstrated by NebuSec. Until the company shifts its security filters from "audit" to "enforcement" and addresses the underlying architectural concerns, the widget feature will likely remain a focal point for security researchers and threat actors alike. The situation remains fluid, and the community is awaiting further updates from Telegram’s engineering team regarding the next iteration of its widget security framework. In the meantime, the incident stands as a stark example of how even well-intentioned security updates can be undermined by fundamental flaws in design and implementation.

Related Articles

Back to top button
Tech Newst
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.