Telegram Desktop QuickJS Widget Sandbox Escape RCE (quickjs-ng #1910)
Published: 2026-11-30 • Researcher: umbra2728 (macOS/Linux/universal ports); bikini / telejam (original Windows research)
- Severity
- Critical
- CVE
- No CVE assigned — quickjs-ng issue #1910 / Telegram Desktop bot widget sandbox escape
- Category
- web
- Affected product
- Telegram Desktop bot widgets (QuickJS-ng widget sandbox)
- Affected versions
- Telegram Desktop 7.4.0 through 7.4.2 (official builds tested); later 7.4.x status is disputed
- Disclosed
- 2026-11-30
- Patch status
- Unverified
Tags
References
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-30 |
| Last Updated | 2026-11-13 |
| Author / Researcher | umbra2728 (macOS/Linux/universal ports); bikini / telejam (original Windows research) |
| CVE / Advisory | No CVE assigned — quickjs-ng issue #1910 / Telegram Desktop bot widget sandbox escape |
| Category | web |
| Severity | Critical |
| CVSS Score | N/A (no CVE or CVSS assigned) |
| Status | Weaponized |
| Tags | telegram, quickjs, quickjs-ng, rce, use-after-free, sandbox-escape, bot-widget, client-side, javascript |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Telegram Desktop bot widgets (QuickJS-ng widget sandbox) |
| Versions Affected | Telegram Desktop 7.4.0 through 7.4.2 (official builds tested); later 7.4.x status is disputed |
| Platforms | Windows x64, macOS arm64, Linux x64/arm64 |
| Language / Platform | JavaScript/HTML widget; native command execution in the Telegram Desktop process |
| Authentication Required | No |
| Network Access Required | Yes (bot can deliver a widget message) |
Summary
Telegram Desktop 7.4.x renders bot widgets in a sandbox powered by QuickJS-ng. A use-after-free in the generator prologue involving disposal of an await using construct leaves JSVarRef pointers on a returned C stack frame. The included HTML PoCs turn that primitive into arbitrary read/write inside the widget sandbox, discover the native image base and imported functions, and redirect a closure to the host process’s native command execution. The universal PoC detects Windows PE, macOS Mach-O or Linux ELF at runtime and runs the matching final stage; the demonstration payloads are Calculator on Windows/macOS and touch /tmp/pwned on Linux.
Vulnerability Details
Root Cause
The widget sandbox uses QuickJS-ng. Disposal of an ordinary-frame await using construct emits OP_await and leaves JSVarRef pointers on a C stack frame that has already returned, producing a use-after-free. The PoC reclaims the freed memory with a resizable ArrayBuffer, forges a JSValue/object layout, and builds read/write primitives over the reclaimed object. It then locates the host image base and imported native functions (WinExec, system, or libc system via ELF symbol resolution) and rewrites a closure so that its call target is the native function.
Attack Vector
A bot delivers an HTML widget to a chat. When the widget message is rendered/opened in a vulnerable Telegram Desktop build, the embedded JavaScript executes in the QuickJS sandbox and triggers the UAF. The sender does not need a file download or a separate click on a link; the widget itself is the attack surface. The included instructions send the HTML through the Bot API sendWidget method.
Impact
Native code execution inside the Telegram Desktop process, outside the widget sandbox. The demonstrated payloads launch Calculator on Windows/macOS or create /tmp/pwned on Linux, but the primitive is arbitrary native execution; a real payload could run any command with the user’s privileges. Telegram Desktop remains running after the demonstration.
Environment / Lab Setup
OS: Windows x64, macOS arm64, or Linux x64/arm64
Target: Official Telegram Desktop 7.4.0–7.4.2 build
Attacker: Telegram bot able to send a widget to the target chat
Tools: curl, python3 (for JSON encoding), a test Telegram accountSetup Steps
- Create a test bot and obtain its token and your numeric chat ID.
- Use a disposable Telegram account and a test chat; do not target third parties.
- Choose one HTML file:
poc-universal.html— runtime OS detectionpoc-win.html/poc-macos.html/poc-linux.html— platform-specific
- Send the widget through the Bot API:
| |
- Open the chat containing the widget in the vulnerable Telegram Desktop build.
Proof of Concept
Step-by-Step Reproduction
- Deliver the HTML as a bot widget to a test chat.
- Render/open the widget in Telegram Desktop 7.4.0–7.4.2.
- The JavaScript triggers the QuickJS-ng UAF, reclaims the freed allocation, and creates arbitrary read/write primitives.
- It walks the native image (PE/Mach-O/ELF), resolves WinExec/system, and rewrites a closure to call the native function.
- The final stage runs the platform payload: calc.exe, open -a Calculator, or touch /tmp/pwned.
Exploit Code
See
poc-universal.html,poc-win.html,poc-macos.htmlandpoc-linux.html.
The files are self-contained HTML/JavaScript PoCs. Their SHA-256 values match the upstream README:
| File | SHA-256 |
|---|---|
| poc-universal.html | 503e5c7536016d44075765d1dd62800e7aa446a25dca6b3fc398f8f9a9ab8459 |
| poc-win.html | 3e2cbc65f8dcb29e2ae78879554f72ad7f3bf48509467d43d60e1e2f346d3347 |
| poc-macos.html | ac512ff672ac894ed074c126b1f331ae2d739ddf0dfcb6f37541ba78ecfd4f2b |
| poc-linux.html | a421bd4a2d1f8e7c47d888f64b160d77ecef57d19bedf8ba06866bd87d0a2337 |
Expected Output
- Windows: Calculator opens from the Telegram Desktop process.
- macOS: Calculator opens from the Telegram Desktop process.
- Linux:
/tmp/pwnedis created. - Telegram Desktop keeps running and responsive.
Detection & Indicators of Compromise
- Unexpected child processes spawned by Telegram Desktop, especially
calc.exe,Calculator,open -a Calculator, or shell commands. - A widget message containing HTML/JavaScript with large typed-array or BigInt manipulation and native image parsing.
- QuickJS-ng crashes or use-after-free reports in Telegram Desktop logs.
- Telegram Desktop process spawning /bin/sh, cmd.exe or PowerShell unexpectedly.
- Bot widgets received from untrusted bots; no CVE exists, so version-based detection must use the client build and widget behavior.
SIEM / EDR rule (example):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade Telegram Desktop past the affected 7.4.0–7.4.2 builds; verify the vendor’s current widget/QuickJS fix status, as later 7.4.x exploitation has been disputed. |
| Workaround | Disable or avoid untrusted bot widgets; restrict bot usage; do not open widget messages from unknown bots. |
| Config Hardening | Monitor Telegram Desktop child processes, restrict untrusted bot interactions, and keep desktop clients current. |
References
Notes
Reviewed 2026-11-30 from the linked repository. The PoCs are self-contained HTML/JavaScript and their SHA-256 values match the upstream README exactly. The payloads are limited to Calculator/touch and contain no network exfiltration, credential access, persistence or C2 logic; the exploit primitive itself is arbitrary native code execution.
No CVE has been assigned to this issue as of 2026-11-30, so this entry is advisory-based rather than CVE-based. The repository has no license file; it is archived with attribution for authorized security research only. The demo GIF and external video were not copied. No exploit code was executed during archival.
| |