Telegram Shipped Bot Widgets. Researchers Broke Out of the Sandbox in Days
Telegram Shipped Bot Widgets. Researchers Broke Out of the Sandbox in Days Last week Telegram gave bots a new power: widgets. Small interactive blocks a bot can send inside a chat, with JavaScript that runs on the user
Telegram Shipped Bot Widgets. Researchers Broke Out of the Sandbox in Days
Last week Telegram gave bots a new power: widgets. Small interactive blocks a bot can send inside a chat, with JavaScript that runs on the user's phone. Two days later, an account called V12 posted a video on X claiming any Telegram message could now be used to execute remote code.
That is the whole story in two sentences. The rest of it is about why a chat client running other people's code is one of the hardest security problems in software, and why the fix Telegram shipped was already being picked apart before the week was out.
What widgets are, and why they matter
A widget is a little app inside a message. A bot sends one, and your phone runs its JavaScript to render something interactive: a game, a form, a mini tool. Telegram runs that JavaScript in QuickJS, a small embeddable engine, and the widget documentation says the code runs in a sandbox, with rules like no network access.
If you build Telegram bots, you know why this is a big deal. Widgets turn a bot from a thing you talk to into a thing you use. Every bot developer I know has wanted something like this for years. It is also, obviously, the riskiest feature a messenger can ship. You are taking code written by a stranger and running it on a billion phones. The sandbox is the only thing standing between a fun little game and a remote code execution bug.
Telegram moved fast once V12's video went up. According to The Hacker News, the Android app moved QuickJS into its own process and added a seccomp filter, the Linux mechanism that can block or record the system calls a process makes. Both changes appear in the source code Telegram published for Telegram for Android 13.2.2. The filter names a few dozen system calls, things like ptrace, bpf and mount, and blocks or logs them.
That sounds like a solid response. It took security researchers at a company called NebuSec less than a week to say it is not enough.
Two bypasses, one calculator
NebuSec published a technical analysis this week claiming its researchers got code running outside that filter in two separate ways. One uses a widget bug the filter does not cover. The other chains a widget bug the filter does cover with a kernel bug. In their video, a bot's widget on Android 13.2.2 opens the phone's calculator app. Opening a calculator is the security researcher's version of a hello world: it proves you are running your own code, not just the widget's.
The researchers are holding back the details for now. Their write-up names no CVE identifier and does not say whether the bugs were reported to Telegram. It also does not say what the code could reach beyond the calculator, such as the app's messages or the rest of the phone, or whether the user had to start the bot or tap the widget first. Those are real gaps, and I am not going to fill them in with guesses. A calculator popping open is proof of execution, not proof of a full takeover.
But the write-up does explain something important about why the sandbox is fragile, and that part does not depend on the undisclosed bugs at all.
The sandbox lives inside the thing it is supposed to contain
Here is the problem, as NebuSec describes it. The widget sandbox rules, including the no-network-access rule, live in the engine's own code. A single use-after-free or out-of-bounds write bug in QuickJS lets a script read and write the process's memory. Once a script can do that, the rules no longer protect anything, because the rules are enforced by the same code the script just escaped from.
This is the difference between a rule and a boundary. A rule says "you are not allowed to do this" and trusts the thing being ruled to obey. A boundary makes it physically impossible. The seccomp filter was supposed to be the boundary, and it has problems of its own.
First, it is a short list. The filter names a few dozen system calls and lets every other call through. It leaves ioctl unfiltered, which is a big one: ioctl is the general-purpose control channel to device drivers, and it is exactly the kind of call you would want locked down in a sandbox.
Second, in the published source code, the filter is set to audit mode. In audit mode it still blocks attempts to start new programs or processes, but it only records the other listed calls and lets them run. A comment above the setting says how long that will last: "Audit until the logs from the devices say the engine never makes them." The Hacker News notes that the published code does not show whether the version people install uses the same setting. So we do not actually know what is running on real phones. But audit mode is a confession in code form: we are not sure what this engine needs, so we are watching before we start blocking. That is a reasonable engineering step. It is not a security boundary.
Third, one process runs every widget. A hijacked widget from one bot shares memory with the widgets of every other bot. The blast radius of a single escape is every widget on the phone.
None of this means Telegram's engineers are careless. It means the feature is genuinely hard, and they shipped it before the sandbox was finished.
What Telegram and Durov said
Pavel Durov wrote late last week that "no one could be hacked just by receiving a message." His post addressed reports of code execution through widgets in the Android and Windows apps, and it came before the NebuSec demonstration. He added that a user first had to start a third-party service, and that even that was fully patched on the server side. Telegram had earlier said the problem in V12's first demonstration was fixed and that the fix had reached all users.
There is also a server-side gate that is doing real work right now: general bots are not currently allowed to use widgets, even in private chats. Only approved bots can send them on the live service, which is why NebuSec ran its demonstration on a Telegram test server. That gate is probably the single most effective mitigation in place, and it is worth noticing that it is not a sandbox at all. It is an allowlist.
Separately, 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 infected system and steal data from crypto wallets and Telegram accounts. Kaspersky's warning does not identify the flaw or the Telegram version, does not report the number of victims, and does not link the activity to either demonstration. It advises not running widgets until a fix is released.
So we have two different pictures at once: a controlled demonstration with withheld details, and a vendor report of suspected real-world abuse with no technical specifics. Neither picture is complete. Both point in the same direction.
What I take from this as someone who builds things
I build an encrypted messenger, and I build Telegram bots. This story hits both of those at once, and I keep coming back to four lessons.
The first is that a sandbox enforced by the sandboxed code is not a sandbox. If your security rules live in the same engine as the untrusted code, one memory bug deletes all of them. Real isolation is enforced from outside: a separate process, a strict syscall filter, and ideally a filter that starts from "block everything" and opens only what is needed, not the other way round. Telegram's filter names a few dozen calls to block and lets the rest through. That is a denylist, and denylists fail exactly the way this one did: through the call you forgot, like ioctl.
The second is that audit mode is a progress report, not a fix. Logging a dangerous call and letting it run is the right way to learn what your engine needs. It is not the same as stopping it. If you ship a feature with a security control in audit mode, say so plainly, and treat the feature as still open until the mode flips. The comment in Telegram's source code is honest about this. The feature's rollout was not.
The third is about blast radius. One process for every widget means one escape compromises every widget. Per-widget processes cost memory and startup time, and on a phone both matter. But the whole point of a sandbox is limiting what a single bug can reach, and sharing a process with every other bot's code is the opposite of that. When I design anything that runs untrusted code, the first question I ask now is not "can it escape" but "what does it reach if it does."
The fourth lesson is the one bot builders should actually act on. If your bot's features depend on the client executing your code, you are depending on the client's sandbox, and you do not control that sandbox. Telegram's server-side allowlist, only approved bots can send widgets, is doing more real protection right now than the seccomp filter. Build your bot so its interesting work happens on your server, behind your own authentication, and treat anything the client runs as code you cannot trust and cannot protect. If the feature you want only exists as client-side code execution, ask whether you need it at all.
None of this means widgets are a bad idea. Mini apps inside chats are genuinely useful, and every major messenger will keep building toward them. The question was never whether to ship the feature. It was whether the sandbox was ready, and the answer, twice in one week, was no.
Telegram will harden this. The filter will get stricter, the audit mode will end, and the allowlist will stay in place until it does. The lesson that sticks with me is older than this story: in a messenger, the client is the attack surface. Every feature that runs someone else's code on a user's phone is a promise that your sandbox holds. Keep that promise before you ship the feature, not after someone demonstrates that it does not.
Sources: The Hacker News, "Researchers Claim Two RCE Exploits That Bypass Telegram's New Android Defenses," November 17, 2026; NebuSec technical analysis, November 2026; Telegram widget documentation, core.telegram.org; Kaspersky malware warning, November 2026.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.