← All articles

Telegram Widgets: Researchers Claim Two Android RCE Paths

Telegram Widgets: Researchers Claim Two Android RCE Paths

Telegram widgets are at the centre of claims that two separate flaws can let malicious JavaScript escape the Android app’s new security controls. Security company NebuSec says it demonstrated both methods on a Telegram test server, where the researchers used a widget to run code outside the protected process and open the phone’s calculator app.

Widgets are small interactive blocks that bots send inside chat messages. Their JavaScript, a programming language used to make web content interactive, runs on the user’s phone. Bots began sending widgets last week. Two days later, an account named V12 posted a video on X claiming that any Telegram message could be used to execute remote code.

Telegram responded by moving QuickJS, the small engine that runs widget JavaScript, into a separate process on Android. It also added a seccomp filter, a control that can block or record requests made by a process to the Android system. Both changes appear in the published source code for Telegram for Android 13.2.2 (7303).

In a technical analysis published earlier this week, NebuSec said its researchers found two ways around the protection. The first uses a widget flaw that the filter does not cover. The second combines a widget flaw that the filter does cover with a kernel bug, meaning a flaw in the core software that controls the operating system.

In the demonstration video, a bot’s widget on Android 13.2.2 (7303) bypasses the filter and opens the calculator application, according to the researchers. Their write-up and demonstration post do not explain what the code could access beyond that. They do not say whether it could reach Telegram messages or the rest of the phone, and they do not say whether a user had to start the bot or tap the widget first.

The researchers have not published the technical details. Their analysis names no CVE identifier, the standard reference used to track a publicly reported software vulnerability, and does not say whether the flaws were reported to Telegram’s developers. It also lists no fixed version. The published Android source code was no newer than 13.2.2 (7303) as of this week.

Telegram’s widget documentation says widgets run in a sandbox, an isolated software area intended to limit what code can do, including rules such as having no network access. NebuSec says those rules are enforced by the engine itself. A single use-after-free, a flaw where software continues using memory after it has been released, or an out-of-bounds write, which puts data outside its permitted memory area, can allow a script to read and change the process’s memory. Once that happens, the researchers say, the sandbox rules no longer provide protection.

The new seccomp filter names a few dozen system calls, which are requests from software to the operating system, including ptrace, bpf and mount. It allows every other call through, and the filter’s source code leaves ioctl unfiltered. The filter also sits on top of Android’s existing limits for the engine process. NebuSec says all widgets run in one process, so a hijacked widget from one bot shares memory with widgets from every other bot.

The published source code adds another uncertainty. The Hacker News found that the filter is set to audit mode in Telegram for Android 13.2.2 (7303). In that mode, attempts to start new programs or processes are still blocked, but other listed calls are recorded and allowed to run. A comment above the setting says: “Audit until the logs from the devices say the engine never makes them.” The published code does not show whether the version installed by users uses the same setting.

Telegram’s bot availability also remains unclear. A contributor to the telegram-bot-api project wrote late last week in a GitHub bug report that general bots were not allowed to use widgets, even in private chats. As of this week, no later message in that thread said which bots were still permitted or that the restriction had been removed. The researchers conducted their demonstration on a test server because only approved bots could send widgets on the live service at the time.

Late last week, Telegram chief executive Pavel Durov wrote that nobody could be hacked simply by receiving a message. His post addressed reports of code execution through widgets in the Android and Windows apps and came before NebuSec’s demonstration. He said a user first had to start a third-party service, and that even this route had been fully patched on the server side. Telegram had earlier said that the issue shown in V12’s first demonstration was fixed and that the fix had reached all users.

Separately, security vendor Kaspersky said late last week that it had detected suspected exploitation of a flaw in Telegram widgets when people visited some Telegram channels. In that activity, a PowerShell script ran without the user noticing and downloaded and launched WebRAT, also known as Salat Stealer. The malware lets attackers control an infected system and steal data from cryptocurrency wallets and Telegram accounts.

Kaspersky’s warning does not identify the flaw or the Telegram version involved, give a victim count, or link the activity to either demonstration. The vendor advises people not to run widgets until a fix is released. For businesses reviewing exposure to this kind of software risk, AEU-I provides security-first IT, infrastructure and consulting.

Until the situation is clearer, avoid starting third-party services or running Telegram widgets unless you have a clear reason to do so. Keep Telegram and Android updated through their official update channels, and check the installed Telegram version after updates. If a Telegram session unexpectedly opens another application or a computer shows an unfamiliar PowerShell window, stop using the device for sensitive tasks and ask a trusted IT or security professional to examine it. Review cryptocurrency wallet and Telegram account activity for anything you do not recognise, and change passwords from a separate device if suspicious activity appears.

Also available in: DeutschItalianoShqip