Days after Telegram introduced interactive HTML widgets for bot messages, cybersecurity firm NebuSec says it bypassed security protections added in response to remote code execution concerns. The company argues that the remaining problem is architectural and has published an alternative design based on stronger process isolation.
Telegram added widgets with Bot API 10.4, allowing bots to send interactive HTML and JavaScript inside messages. Shortly after launch, security firm V12 demonstrated what it described as native code execution through a bot-supplied widget.
Telegram responded on Android by moving the QuickJS JavaScript engine into a separate process, applying a seccomp system-call filter, and restricting widgets on its production service to approved bots. NebuSec later demonstrated what it says is a way to escape those protections on a patched Telegram build in the platform’s test environment.
Why the patch can still be bypassed
Telegram widgets use QuickJS-ng, a compact JavaScript engine written in C. In the original implementation, the engine ran inside Telegram’s main application process, so a memory-corruption vulnerability could potentially give malicious widget code access to data and capabilities belonging to the wider app.
Moving QuickJS into a separate process created an additional security boundary, but NebuSec argues that the protection still leaves important gaps. Telegram’s seccomp policy blocks a defined set of dangerous system calls while permitting many others, including ioctl operations, and multiple widgets can share the same process.
NebuSec says it found two paths to code execution outside the intended seccomp restrictions. One uses a widget vulnerability that the filter does not cover, while the other combines a widget vulnerability with a kernel flaw. The company is withholding technical details because it says both approaches have multiple possible variants.
A public vulnerability archive also documents several flaws discovered in Telegram’s widget runtime, including a QuickJS-ng parser vulnerability rated as high as CVSS 9.6. The archive says the documented bugs affected earlier Telegram builds across Android, iOS, desktop, and macOS but have been fixed in current versions.
The research says widget JavaScript begins running when a widget is rendered in an opened chat, without requiring the user to tap the widget itself. Telegram CEO Pavel Durov has disputed broader claims that someone could be compromised simply by receiving a message, saying an attack required the user to first start a third-party service and that the relevant issue had been patched.
SecurityWeek also reported that Kaspersky observed suspicious activity in which a PowerShell script downloaded WebRAT after users visited certain Telegram channels. Kaspersky did not disclose the exact vulnerability involved or establish that the activity used the same widget exploits demonstrated by other researchers.
A browser-inspired redesign
Rather than only documenting weaknesses in Telegram’s implementation, NebuSec built a hardened widget runtime based on the way modern browsers isolate untrusted code.
Its design runs widget JavaScript inside an isolated Android service away from the process handling accounts and messages. Communication with the main application is restricted to validated instructions, while additional memory isolation is intended to stop a compromised widget from reaching other parts of the app or other widgets.
NebuSec also proposes a stricter seccomp policy that permits only the system calls the service actually needs, rather than blocking a selected list of dangerous calls.
The company argues that simply replacing QuickJS with a larger engine such as V8 would not solve the underlying problem. Instead, Telegram should assume the scripting engine could eventually be compromised and design the surrounding system to limit what an attacker could reach if that happens.
Telegram has not publicly responded to NebuSec’s latest bypass claims or proposed architecture, and the production widget feature remains restricted to approved bots.

Leave a Reply