Skip to content
Prototype pollution Advisory Advanced CVE-2026-12459

Inappropriate implementation in Serial (CVE-2026-12459)

A cached WritableStream shared between a page's main world and an extension's isolated world could return a pending abort promise created in the isolated world to the page. An attacker page could then reach the isolated world's prototypes and attempt prototype pollution or script execution in the extension context.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 20 days

Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: The static WritableStream::Abort method can potentially return a pending abort promise from a different DOMWrapperWorld without context validation. When a WritableStream is cached and shared across different worlds—such as via the cached SerialPort::writable stream—a page can potentially obtain a V8 Promise belonging to an extension's isolated world. This could allow prototype pollution or execution hijacking inside the privileged isolated world.

Affected files:

  • third_party/blink/renderer/core/streams/writable_stream.cc
  • third_party/blink/renderer/modules/serial/serial_port.cc

Estimated timestamp from git blame: 2019-07-09

Technical Analysis

In third_party/blink/renderer/core/streams/writable_stream.cc, the WritableStream::Abort method implements the streams specification for handling a pending abort request:

C++
if (stream->pending_abort_request_) {
  return stream->pending_abort_request_->GetResolver()->Promise();
}

The method returns the ScriptPromise of the ScriptPromiseResolver that was created during the initial abort() call. However, it does not verify whether the current caller's ScriptState (and its associated DOMWrapperWorld) matches the ScriptState used to create the pending abort request's resolver.

When a WritableStream is shared across worlds, this lack of validation can lead to cross-world leaks. Specifically, SerialPort instances are shared across worlds because Serial is a Supplement<NavigatorBase>, which deduplicates ports in port_cache_ (third_party/blink/renderer/modules/serial/serial.cc). When the page (main world) and an extension content script (isolated world) access the same port, they obtain wrappers pointing to the same C++ SerialPort instance.

Additionally, SerialPort::writable caches the stream in its writable_ member:

C++
WritableStream* SerialPort::writable(ScriptState* script_state, ...)
{
  if (writable_)
    return writable_.Get();
  ...
}

Consequently, subsequent calls to writable in different worlds return the exact same C++ WritableStream object.

If a content script invokes port.writable.abort() while the stream's start promise is pending (i.e. before controller->started_ becomes true, which remains false during the synchronous execution scope of CreateWithCountQueueingStrategy), a PendingAbortRequest containing an isolated world's ScriptPromiseResolver is stored on the stream. When the page subsequently invokes port.writable.abort() within the same synchronous tick, WritableStream::Abort retrieves and returns the isolated world's raw v8::Promise directly to the page script.

Potential Impact

Because standard V8 JavaScript objects (like JSPromise) do not have access checks enabled, an attacker in the main world who obtains a reference to a leaked v8::Promise from the isolated world can traverse the prototype chain (e.g., via Object.getPrototypeOf(p)) to directly access the isolated world's Promise.prototype and Object.prototype. This enables prototype pollution attacks targeted at the privileged isolated world context, potentially leading to Universal Cross-Site Scripting (UXSS) and arbitrary script execution inside the extension's context.

Suggested Steps to Trigger (Potential Flow)

Note: These steps are theoretical/suggested. Our static review environment does not currently have the capability to execute code or run a dynamic proof of concept.

  1. A web page requests and receives access to a Web Serial port.
  2. An extension content script is injected and obtains a reference to the same SerialPort instance via navigator.serial.getPorts().
  3. The web page sets up a synchronous DOM event listener (e.g., via element.dispatchEvent) that triggers a callback in the content script.
  4. When the synchronous event fires, the content script callback accesses port.writable for the first time, initializing the stream using its isolated world's ScriptState. It then calls port.writable.abort(), which stalls and populates pending_abort_request_ with a resolver from the isolated world context.
  5. The content script callback returns, and the page script immediately calls port.writable.abort().
  6. The page script receives the leaked Promise p belonging to the isolated world context.
  7. The page script accesses and pollutes the isolated world's prototypes using prototype traversal (Object.getPrototypeOf(Object.getPrototypeOf(p))).

Recommended Remediation

To prevent this leak, the sharing of the exact same C++ WritableStream instance across different DOMWrapperWorld contexts should be restricted, or the returned promise should be safely translated to the caller's context:

  1. Avoid cross-world sharing of streams: Modify SerialPort::writable and SerialPort::readable so they do not cache and return the same C++ stream instance to different worlds. Instead, return a world-specific WritableStream or map the underlying data pipe dynamically.
  2. World-aware Promises: If streams must be shared, utilize a mechanism like ScriptPromiseProperty which maintains separate resolvers for each DOMWrapperWorld, or explicitly validate/re-create the returned promise in the current caller's ScriptState context inside WritableStream::Abort.

Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the abort path returns a cached pending promise without checking that the caller's world matches the world that created the resolver, while the serial port and its writable stream are cached and shared across worlds.

Impact

This could allow prototype pollution and arbitrary script execution inside the extension's isolated world, though the report is a static analysis and no working exploit was demonstrated.

What the attacker needed

Page has Web Serial port access; extension content script on same page; synchronous cross-world callback timing

The fix

The stream should not be cached and shared across worlds, or the returned promise should be validated or recreated in the caller's context.

How it was found

  1. A page obtains access to a Web Serial port.
  2. An extension content script gets a reference to the same port.
  3. The page sets up a synchronous event that runs a content script callback.
  4. The content script accesses the writable stream and calls abort, storing a pending request from its world.
  5. The page then calls abort on the same stream and receives the isolated world's promise.
  6. The page traverses the promise's prototypes to pollute the isolated world.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A browser page and an extension's content script run in separate 'worlds' so they cannot normally touch each other's JavaScript objects. Here a stream object was cached and handed to both, and an abort call returned a promise made in the extension's world to the page. The page could then walk that promise's prototype chain into the extension's objects.

What is Prototype pollution?

Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Prototype pollution

The lesson behind this report.

Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.