Skip to content

Bump quickjs: cycle-GC use-after-free fix for async closures#36

Merged
syrusakbary merged 6 commits into
mainfrom
fix/async-generator-gc-uaf
Jun 30, 2026
Merged

Bump quickjs: cycle-GC use-after-free fix for async closures#36
syrusakbary merged 6 commits into
mainfrom
fix/async-generator-gc-uaf

Conversation

@Arshia001

Copy link
Copy Markdown
Member

Bumps the quickjs submodule to wasmerio/quickjs#6 (fix/async-generator-gc-uaf, a5522a7), which ports the CVE-2023-48184 / bellard#156 fix to our quickjs-ng tree.

The cycle collector could free a Promise resolving function still referenced by a suspended async generator's closure var_ref → heap-use-after-free in gc_decref_child during a later GC. Surfaces in async-heavy apps iterating streams (Etherpad, undici); reproduces deterministically with for await (const x of socket) under GC pressure.

⚠️ Not final until wasmerio/quickjs#6 merges — after it merges, update this submodule pointer to the merged commit.

🤖 Generated with Claude Code

sadhbh-c0d3 and others added 5 commits June 15, 2026 10:58
EdgeJS now resolves Node tests and fixtures from the repo root, so the
V8 and QuickJS CMake entry points no longer need a separate upstream
Node checkout path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Place eval_flags before filename in napi_contextify so the struct matches
QuickJS header field order and WASIX/native builds compile cleanly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Points the quickjs submodule at wasmerio/quickjs#6
(fix/async-generator-gc-uaf, a5522a7), porting the CVE-2023-48184 /
bellard#156 fix so the cycle collector no longer frees a value still
referenced by a suspended async generator's closure var_ref.

NOTE: not final until wasmerio/quickjs#6 merges; update this pointer to the
merged commit afterward.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Arshia001 added a commit to wasmerio/edgejs that referenced this pull request Jun 30, 2026
Brings in wasmerio/napi#36 -> wasmerio/quickjs#6, porting the
CVE-2023-48184 / bellard#156 fix to our quickjs-ng tree. The cycle
collector no longer frees a Promise resolving function still referenced by
a suspended async generator's closure var_ref (heap-use-after-free in
gc_decref_child during a later GC). Surfaces in async-heavy apps iterating
streams (Etherpad, undici); reproduces with `for await (const x of socket)`
under GC pressure.

This complements the handle-wrap teardown fix already in this branch; both
are QuickJS GC use-after-free fixes.

NOTE: not final until wasmerio/quickjs#6 and wasmerio/napi#36 merge; update
the napi pointer to the merged commit afterward.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pulls in wasmerio/quickjs 14bf204, which fixes a heap-use-after-free where
open closure var_refs could outlive the async frame they point into when an
incomplete async function/generator is freed during cycle collection.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@syrusakbary syrusakbary merged commit 0e2d562 into main Jun 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants