Security

Telegram widget RCE claim: what the Android code shows

Telegram's Android 13.2.2 code moves widgets into an isolated process after an RCE claim. Durov says no one could be hacked just by receiving a message.

In brief

  • The update changes 6,792 lines. Its system-call filter logs most disallowed calls but lets them proceed.
  • On November 13, Pavel Durov said Telegram had patched the issue on its servers. Bybit urged users to update immediately.
Telegram widget RCE claim: what the Android code shows

Telegram changed how its Android app runs the new in-chat widgets in version 13.2.2, whose source code it published on November 12, a day after security firm V12 posted that "any telegram message can now become RCE," meaning remote code execution. The new code moves widget scripts into an isolated Android process with no network access and adds a filter on system calls. Telegram founder Pavel Durov said on November 13 that "no one could be hacked just by receiving a message" and that the problem was patched on Telegram's servers. Crypto exchange Bybit told users the same day to update Telegram immediately.

Telegram launched widgets on November 9 with Bot API 10.4. They let bots send small HTML and JavaScript apps that run inside a chat message, and in production they can only be sent in private chats with a bot. They are also tied to Telegram's built-in TON wallet: a widget query can carry "the TON wallet card of the user, data signed by a TON wallet of the user, or a notification about a transaction sent from a TON wallet of the user," the changelog says. Telegram's widget guide says the wallet card includes the address and balance and is requested only after the user taps: "Never in the background." Durov said more than 700,000 wallets were created in the 48 hours after Grams launched.

What the Android code changed

Telegram publishes its Android source on GitHub. The 13.2.2 commit, dated 02:43 UTC on November 12, adds a widget engine service and a seccomp system-call filter and changes 6,792 lines. The project's notes on the widget engine say widget code, including JavaScript run by the QuickJS engine, now sits in an isolated process with "no permissions, no network" and no access to the app's files. The filter is not fully enforced yet. The notes describe an audit mode in which most blocked calls are logged and then allowed, while attempts to start new programs or processes are refused. The 13.2.1 code, published on November 7, two days before widgets launched, has no such service.

The same notes list fixes to Telegram's copy of QuickJS dated November 6, 9 and 10. The November 6 batch includes "the RegExp bytecode use-after-free of the widget RCE report." The November 10 fix, for a use-after-return "from widget script," is marked "reported against 13.2.1." The notes do not say who filed those reports or whether they match V12's findings. Telegram has not published a security advisory or a CVE identifier for the widget engine, and V12's November 11 post names no app version. OnchainBeat did not independently test the attack shown in V12's video.

What V12, Durov and Bybit say

V12 says the risk goes beyond any single bug. In a second post at 01:00 UTC on November 13, it said it had another remote code execution flaw, this time in Telegram's Windows client, which it called patched in quotation marks. "Even if individual bugs get patched, allowing (unsandboxed!) QuickJS in messages massively opens up the attack surface," the firm wrote.

Durov replied in a Telegram post at 16:02 UTC that day about the reports on "new TG Android/Windows widgets." He wrote: "The issue doesn't exist. No one could be hacked just by receiving a message. You had to actively start a third-party service first." He added: "Even that is fully patched server-side." He then invited readers to try to hack his account.

Bybit's advisory, posted at 11:22 UTC on November 13, names no version. It tells users to "Update Telegram to the latest version immediately," to avoid unfamiliar chats and unknown bots, and warns that "A compromised device could also put other apps at risk." Telegram has not said which store release first carried the 13.2.2 changes.

The widget reports follow a separate Telegram for Android flaw disclosed on October 29. The Hacker News reported that a voice-call bug found by security startup NebuSec affected versions 8.6.2 through 12.10.3 and was fixed in version 12.10.4, released in late September.

How we verified Checked against the document (Telegram: API changelog), the document (Telegram: Widgets) and the document (DrKLO/Telegram on GitHub).

Sources

Checked by OnchainBeat · 6 links, 5 primary documents
  1. DocumentTelegram: API changelogcore.telegram.org
  2. DocumentTelegram: Widgetscore.telegram.org
  3. DocumentDrKLO/Telegram on GitHubgithub.com
  4. DocumentGithubusercontent: Readmeraw.githubusercontent.com
  5. DocumentDrKLO/Telegram on GitHubgithub.com
  6. Post on Xv12sec post on X (2120471754166415821)x.com