Skip to content

2026 06 16 upstream changes#6822

Merged
danlapid merged 488 commits into
mainfrom
maizatskyi/2026-06-16-upstream
Jun 18, 2026
Merged

2026 06 16 upstream changes#6822
danlapid merged 488 commits into
mainfrom
maizatskyi/2026-06-16-upstream

Conversation

@mikea

@mikea mikea commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

dom96 and others added 30 commits June 1, 2026 15:09
Throw error when expectedServerHostname is passed to startTls in prod

See merge request cloudflare/ew/workerd!161
just update capnproto

See merge request cloudflare/ew/workerd!184
… JSG_STRUCT unwrap to prevent process abort via prototype pollution

FieldWrapper::unwrap in src/workerd/jsg/struct.h used v8::Object::Get()
which performs a full ECMA-262 [[Get]] with prototype chain traversal.
When called from inside V8's ValueDeserializer host-object callback
(which installs a DisallowJavascriptExecution scope), a getter installed
on Object.prototype by attacker-controlled JS would trigger V8_Fatal →
abort(), killing the entire workerd process and all co-located tenant
isolates. The slow-path FieldWrapper::wrap (compat date < 2025-12-03)
also omitted kj::none Optional fields from the serialized init-dict
object, leaving those field names absent as own properties and forcing
the prototype chain lookup during deserialization.

The fix conditionally replaces Get() with HasOwnProperty + GetRealNamedProperty
(own-property-only, no prototype chain traversal) in unwrap.

The regression test installs Object.prototype getters on several
RequestInitializerDict field names (redirect, method, signal) and calls
structuredClone(new Request(...)) — pre-patch this deterministically
aborted the process; post-patch the clone succeeds normally.

Test validation: VALIDATED LOCALLY
Pre-patch run: FAIL (bazel test //src/workerd/api/tests:struct-prototype-pollution-test@)
Post-patch run: PASS (bazel test //src/workerd/api/tests:struct-prototype-pollution-test@)

Refs: AUTOVULN-CLOUDFLARE-WORKERD-369

See merge request cloudflare/ew/workerd!39
VULN-136602: fix(jsg): conditionally use own-property-only lookups in JSG_STRUCT unwrap to prevent process abort via prototype pollution

See merge request cloudflare/ew/workerd!39
Restore external memory accounting for global actor channels

See merge request cloudflare/ew/workerd!201
…il next turn of event loop

* fix(server): defer dynamic WorkerService destruction until next turn of event loop

DeleteQueue::scheduleDeletion() previously took the synchronous inline-delete
fast path whenever IoContext::current() matched, regardless of whether the
caller was inside a cppgc finalizer. When a WorkerStub (holding a child
v8::Isolate via WorkerStubImpl → WorkerService → Worker::Isolate) was
garbage-collected by the parent isolate, the parent's CppgcShim::~CppgcShim()
set the thread-local inCppgcShimDestructor flag and then synchronously
destroyed the child isolate chain. The child's HeapTracer::clearWrappers()
hit KJ_ASSERT(!inCppgcShimDestructor) at wrappable.c++:40 (the flag is
process-wide, not per-isolate), throwing from inside V8's noexcept cppgc
sweeper and triggering std::terminate().

The new worker-loader-gc-test exercises the exact crash scenario: load an
anonymous child worker, make a request to force full construction, drop the
stub, and trigger gc(). Pre-fix this aborts the process; post-fix the
deferred deletion completes safely. (AUTOVULN-CLOUDFLARE-WORKERD-102)

Test validation: VALIDATED LOCALLY
Pre-patch run: FAIL (bazel test //src/workerd/api/tests:worker-loader-gc-test@)
Post-patch run: PASS (bazel test //src/workerd/api/tests:worker-loader-gc-test@)

Refs: AUTOVULN-CLOUDFLARE-WORKERD-102

See merge request cloudflare/ew/workerd!6
VULN-136569: fix(server): defer dynamic WorkerService destruction until next turn of event loop

See merge request cloudflare/ew/workerd!6
Bump v8 to 14.9

See merge request cloudflare/ew/workerd!121
Normally, messages are caught by TryCatch scopes, but in some cases there is no scope.
This causes the message to be logged by the DefaultMessageListener to stdout, which
pollutes Kibana with things that should be js exceptions.
Add v8::Isolate MessageListener to log any messages

See merge request cloudflare/ew/workerd!205
GC tracing of the queue is unnecessary and potentially
dangerous. Most of it was non-op already. The danger
comes from cases like:

```cpp
struct Foo {
  jsg::Ref<Bar> bar;
  void visitForGc(jsg::GcVisitor& visitor) {
    visitor.visit(bar);
  }
}

auto foo = kj::heap<Foo>();
// something gc visits foo...

auto foo2 = kj::mv(foo);
// nothing visits foo2!
```

In the first visit, `bar` is marked weak. After
the move, if nothing gc visits `foo2` before the
next GC cycle, the garbage collector can decide
that `bar` is unreachable and collect it. There's
nothing in the move that would cause `bar` to be
marked strong again (unlike moving the `jsg::Ref`
itself).
A handful of changes in here, focused on improving the
robustness of queue.h/queue.c++. Extracted from the
larger reverted commit.
And as a bonus, fix two streams WPTs
Allow the standard AllReader to support strings and SAB's
Remove the original path and the autogate. Autogate has
been deployed for a while.
Remove jsg::BufferSource/BackingStore from modules-new

See merge request cloudflare/ew/workerd!183
Remove Lock::bytes() and Lock::arrayBuffer() methods

See merge request cloudflare/ew/workerd!186
kentonv and others added 7 commits June 16, 2026 10:44
The workers-rpc.c++ instance was caught by ASAN. The others probably got by due to the channel still being referenced by the app until GC.
Don't use JSRPC for AI binding's toMarkdown() API.

See merge request cloudflare/ew/workerd!297
* Guard against WeakRef being torn down after isolate

See merge request cloudflare/ew/workerd!303
Guard against WeakRef being torn down after isolate

See merge request cloudflare/ew/workerd!303
Implement persistent stubs

See merge request cloudflare/ew/workerd!267
update capnp to bring Pin/Ptr/Weak improvements

See merge request cloudflare/ew/workerd!305
@mikea mikea requested review from a team as code owners June 16, 2026 20:22
@mikea mikea requested a review from james-elicx June 16, 2026 20:22
…yi/2026-06-16-upstream

# Conflicts:
#	cfsetup.yaml
#	ci/build.yml
#	src/workerd/api/actor.c++
@mikea mikea force-pushed the maizatskyi/2026-06-16-upstream branch from 8b67028 to 418e9d3 Compare June 16, 2026 20:26
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

The generated output of @cloudflare/workers-types matches the snapshot in types/generated-snapshot 🎉

@codspeed-hq

codspeed-hq Bot commented Jun 16, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 70.84%

⚡ 1 improved benchmark
✅ 71 untouched benchmarks
⏩ 129 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
request[RegExpBenchmark] 7 ms 4.1 ms +70.84%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing maizatskyi/2026-06-16-upstream (10ee34e) with main (30243d1)

Open in CodSpeed

Footnotes

  1. 129 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@mikea mikea force-pushed the maizatskyi/2026-06-16-upstream branch from 8d4ae57 to 311ea56 Compare June 17, 2026 15:48
@danlapid danlapid merged commit 7d71003 into main Jun 18, 2026
22 of 23 checks passed
@danlapid danlapid deleted the maizatskyi/2026-06-16-upstream branch June 18, 2026 16:35
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.