[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112760":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":14,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":19,"hasPages":19,"topics":21,"createdAt":9,"pushedAt":22,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":15,"starSnapshotCount":15,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},112760,"telejam","bikini\u002Ftelejam","bikini","telegram RCE",null,"HTML",194,73,3,1,0,8,51,51.71,false,"main",[],"2026-11-12 15:01:50","2026-11-23 14:32:08","\n## Findings\n\n| # | Root cause | Upstream status on 2026-11-12 | Demonstrated impact |\n| --- | --- | --- | --- |\n| 1 | `await using` in an ordinary QuickJS frame leaves `JSVarRef` pointers on a returned C stack frame | Fixed by [`ca3594d`](https:\u002F\u002Fgithub.com\u002FTelegramMessenger\u002Fquickjs\u002Fcommit\u002Fca3594dae5fd0dd6d667be74a322e8e935a2d217) | Calculator from stock Telegram Desktop 7.4.2 |\n| 2 | Generator parameter-prologue closures are created before the coroutine owner is installed | Public [quickjs-ng #1910](https:\u002F\u002Fgithub.com\u002Fquickjs-ng\u002Fquickjs\u002Fissues\u002F1910), open and still present in Telegram's current pins | Calculator from stock Telegram Desktop 7.4.2 |\n| 3 | A failed constant-pool growth returns `-1`, which is later used as an array index | No exact public match found; current upstream branches remain affected | 16-byte heap underwrite and `STATUS_HEAP_CORRUPTION`; RCE not demonstrated |\n\nThe first two findings are independent RCE roots. The third is an apparently unreported memory-corruption issue, not an RCE claim.\n\n## 1. Ordinary-frame `await using` use-after-return\n\n### Summary\n\nA bot-delivered widget launched Windows Calculator from the official signed Telegram Desktop 7.4.2 x64 process. Telegram remained alive and responsive. This is distinct from the earlier RegExp bytecode UAF.\n\nDesktop 7.4.2 embeds widget-sandbox `a74626d6768b5d14e0dc0b8435a7df44a980a8e7` and QuickJS `8f0d3b6193a01bda29d69b0cab4f03320bcaa027`, which predates the fix.\n\n### Root cause and chain\n\nQuickJS accepts `for (await using ...)` inside a non-async class static block. Disposal emits `OP_await`; the normal interpreter frame exits through `done_generator` without `close_var_refs()`, leaving captured `JSVarRef` pointers into a returned C stack frame.\n\n[`poc.html`](poc.html) turns deterministic frame reuse into a forged string-backed `JSVarRef`, corrupts a string length to obtain a heap leak and address-selected `JSValue` access, and corrupts a `Uint8Array` for byte-precise arbitrary read\u002Fwrite. A native function pointer reveals the image base. A forged `JS_CLASS_C_CLOSURE` record calls Telegram's resolved `WinExec` import with `calc.exe` and returns cleanly.\n\n- PoC SHA-256: `6B385FBF009B6923727B84448D3C460351733A8EEA953479279E30EBFF4FDF90`\n- Fix: reject suspending opcodes in ordinary frames and ensure every frame-closing path closes its variable references.\n\n## 2. Generator-prologue use-after-free\n\n### Summary\n\nThe second RCE uses the generator lifetime bug described in [quickjs-ng #1910](https:\u002F\u002Fgithub.com\u002Fquickjs-ng\u002Fquickjs\u002Fissues\u002F1910), not the `await using` path. The issue was open without a linked fix when this package was updated. The vulnerable ordering is present in the QuickJS revisions pinned by Telegram Desktop 7.4.0, 7.4.1, 7.4.2, the inspected Desktop development tip, and current widget-sandbox main.\n\nThe exact comments-free [`poc2.html`](poc2.html) was sent through the production Bot API to an authorized private test chat. Starting with no Calculator process, stock Telegram Desktop 7.4.2 rendered the widget and launched CalculatorApp 4.29 seconds after delivery. The original Telegram process remained responsive. No modified client or widget harness was involved.\n\n### Root cause and chain\n\nDuring a generator's initial parameter prologue, a default expression can create a closure over `arguments`. `get_var_ref()` sees `sf->cur_gc_obj == NULL`, so the open variable reference is neither registered with the cycle collector nor given a counted edge to the generator. `js_call_generator_function()` creates the generator object and assigns `cur_gc_obj` only after the first resume has already run that prologue.\n\nThe PoC stores the generator in its own `arguments` object and drops the ordinary iterator reference. Automatic collection then frees the generator cycle while a reachable closure can still return the dangling `arguments` object. A 120-byte resizable `ArrayBuffer` reclaims the freed allocation, yielding a forged object, pointer disclosure, and arbitrary byte read\u002Fwrite. The payload resolves `WinExec` from Telegram's PE imports and invokes it through a forged C-closure finalizer.\n\n- PoC size: `4,077` bytes; zlib level 9: `1,520` bytes\n- PoC SHA-256: `3E2CBC65F8DCB29E2AE78879554F72AD7F3BF48509467D43D60E1E2F346D3347`\n- Stock target SHA-256: `3864695188C5D564C7A6036B04ADB4E67D589F7843C51891155EA4905EB41963`\n- Proposed fix: install the generator or async-generator owner before any user-observable prologue work, or promote every prologue-created open variable reference immediately after the owner is created.\n\n## 3. Apparently unreported constant-pool OOM underwrite\n\n### Summary\n\nTelegram's current QuickJS tip `b526a817f188ef861eea7666d68361c7851673a0`, current widget-sandbox v0.6.5 at `1cde0068daba8437f53eac0b61c395d29b8f89e3`, quickjs-ng master, and Bellard QuickJS master all retained this source pattern when inspected. Telegram Desktop 7.4.2's older QuickJS pin contains the same operations, although this trigger was not delivered to the stock client.\n\nPublic issue, pull-request, and commit searches found no exact match for the `cpool_add()` \u002F `parent_cpool_idx` failure path. That supports “apparently unreported,” not proof that no private report exists.\n\n### Root cause\n\n`cpool_add()` returns `-1` when `js_resize_array()` cannot grow a function's constant pool. `js_parse_function_decl2()` stores that unchecked value in `fd->parent_cpool_idx` and continues. Release `js_create_function()` relies only on an `assert(cpool_idx >= 0)` and later executes:\n\n```c\nfd->cpool[cpool_idx] = func_obj;\n```\n\nWith `cpool_idx == -1`, the 16-byte `JSValue` is written immediately before the pool. On tested 64-bit builds, the first qword is a child-bytecode heap pointer and the second is the fixed `JS_TAG_FUNCTION_BYTECODE` tag (`-2`). This overwrites allocator metadata, but neither the destination nor the stored pointer bits are freely selected.\n\n### Validation and limits\n\nAn exact-current full widget host reached the failed pool growth, negative index, and underwrite in 20\u002F20 logging-only diagnostic runs. An unmodified Release host produced Windows `STATUS_HEAP_CORRUPTION` in 5\u002F100 fresh runs; the other runs followed the sandbox memory-limit death path. Pristine ASan builds reproduced the out-of-bounds write 10\u002F10.\n\nNo arbitrary read\u002Fwrite, indirect-call control, sandbox escape, command execution, or Calculator launch was obtained from this root. Its demonstrated impact is native heap corruption and denial of service.\n\nThe direct fix is to check every `cpool_add()` result before storing or emitting the index, propagate OOM from the function and class helper callers, and add a Release runtime bounds check in `js_create_function()` as defense in depth.\n\n## Reproduction safety\n\nUse only an isolated, authorized test environment. Send the exact contents of `poc.html` or `poc2.html` as the raw `html` string of a Bot API `sendWidget` request to a private test chat, then display the widget in an affected Desktop client. Both files intentionally cross the JavaScript\u002Fnative boundary and are restricted to launching Calculator on the tested image. No token, chat identifier, account data, or other secret is included.\n\nDelete test messages afterward and rotate any bot credential that was exposed during testing.\n","这是一个针对 Telegram Desktop 客户端（7.4.2 及之前版本）WebWidget 沙箱中嵌入的 QuickJS 引擎所发现的远程代码执行（RCE）漏洞利用集合。项目包含两个独立验证的 RCE 利用链：其一基于 `await using` 在普通 JS 帧中导致的 JSVarRef 悬垂指针；其二基于 Generator 参数预处理阶段闭包生命周期管理缺陷。利用 HTML 页面（PoC）在无用户交互前提下触发沙箱内任意本地进程执行（如启动计算器），不导致客户端崩溃。适用于安全研究人员对 Telegram Widget 沙箱机制、QuickJS 内存安全及桌面客户端 JS 引擎漏洞利用链的分析与复现。",2,"2026-11-24 04:44:04","CREATED_QUERY"]