Telegram Widgets Under Scrutiny: Researchers Claim Two Ways Around the New Android Defenses

Telegram bots can now send small interactive blocks called widgets inside chats. They run JavaScript on the user’s own phone, so any weakness in how they are contained matters a great deal. Within days of their launch, security researchers say they have found ways to break out of the sandbox.
What happened
Bots could start sending widgets last week. Two days later, an account called V12 posted a video on X claiming that any Telegram message could now be used to execute remote code. Telegram responded by moving QuickJS, the small engine that runs widget JavaScript, into its own process on Android and adding a seccomp filter, which can block or record the system calls that process makes. Both changes appear in the published source code for Telegram for Android 13.2.2 (7303).
This week, the security company NebuSec published an analysis claiming it got code running outside that filter in two separate ways. One uses a widget bug that the filter does not cover, and the other chains a widget bug that the filter does cover with a kernel bug. In their demonstration video, a bot’s widget on Android 13.2.2 (7303) bypasses the filter and opens the phone’s calculator app. The researchers ran this on a Telegram test server, because only approved bots can send widgets on the live service at the moment.
What the researchers did not say
The write-up leaves several important questions open. It does not say what the code could reach beyond opening an app, such as the user’s messages or the rest of the phone, and it does not say whether the user had to start the bot or tap the widget first. The researchers are holding back details for now, name no CVE identifier and do not say whether they reported the bugs to Telegram. These are claims from one research team, and the article notes no independent confirmation.
Why sandboxing is hard here
Telegram’s documentation says widgets run in a sandbox, with rules such as no network access. NebuSec points out that those rules live inside the engine’s own code, so a single memory bug in QuickJS, such as a use-after-free or an out-of-bounds write, lets a script read and write the process’s memory and the rules stop protecting anything. The new filter blocks a few dozen named system calls, such as ptrace, bpf and mount, and lets every other call through, and it leaves ioctl unfiltered. It also sits on top of Android’s own limits on the process. In addition, one process runs all widgets, so a hijacked widget from one bot shares memory with the widgets of every other bot.
The filter may not be fully enforcing yet
The Hacker News looked at the published source code and found that the filter is set to an audit mode. In that mode it still blocks attempts to start new programs or processes, but for the other listed calls it only records them and lets them run. A code comment says this will continue until device logs show the engine never makes those calls. The published code does not show whether the version people actually install uses the same setting.
Telegram’s response
Telegram’s chief executive, Pavel Durov, said in a channel post last week that no one could be hacked just by receiving a message, and that a user first had to start a third-party service, which he said was fully patched on the server side. That post came before NebuSec’s demonstration. The company had earlier said that the problem in V12’s first demonstration was fixed and the fix had reached all users. Meanwhile, a contributor to the telegram-bot-api project wrote in a GitHub thread that general bots currently aren’t allowed to use widgets, even in private chats. The article lists no fixed version, and the published Android source is no newer than 13.2.2 (7303) as of this week.
A separate warning from Kaspersky
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, malware that lets attackers control the system and steal data from crypto wallets and Telegram accounts. Kaspersky’s warning does not identify the flaw or the Telegram version, does not give the number of victims and does not link the activity to either demonstration. It advises users not to run widgets until a fix is released.
What you should do
Keep Telegram updated on every device and install new versions as soon as they appear. Until the situation is clearer, follow Kaspersky’s cautious advice and avoid interacting with widgets, particularly from unfamiliar bots or channels. Be wary of starting bots you don’t know, and treat any unexpected file or script prompt after opening a Telegram channel as a warning sign. Anyone who handles crypto wallets or sensitive accounts through Telegram should be especially careful.
Final thoughts
This episode shows how hard it is to run untrusted code inside a messaging app safely. Each added layer of defense helps, but if the underlying engine has memory bugs and the filter is still in a learning mode, the protection is only as strong as its weakest part. It will be worth watching whether Telegram publishes a full fix and whether the claimed bypasses are confirmed.
Reference




Comments