Skip to content
Memory corruption Advisory Advanced CVE-2026-11249

Use after free in Network (CVE-2026-11249)

A logic flaw in SocketDataPump causes it to incorrectly determine that the send path is idle when a write is pending, leading to premature destruction of the pump and unmapping of Mojo shared memory while the socket retains a dangling pointer. An attacker could potentially cause the socket to send remapped sensitive cross-origin data to an attacker-controlled server.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 2 months

Project Fortify, an experimental security project, has identified the following potential security issue.

Overview: SocketDataPump incorrectly determines if its send path is idle because it checks send_stream_.is_valid() which becomes false during an active pending write. This logic flaw allows the pump to be prematurely destroyed, unmapping the Mojo shared memory while the underlying socket retains a dangling pointer to it. When the socket eventually becomes writable, it may send remapped sensitive cross-origin data to an attacker-controlled server.

Affected files:

  • services/network/socket_data_pump.cc
  • services/network/tcp_connected_socket.cc
  • services/network/proxy_resolving_socket_mojo.cc

Estimated timestamp from git blame: 2024-09-03

Vulnerability Description

A potential Use-After-Unmap (UAF/UAU) vulnerability exists in services/network/socket_data_pump.cc due to a logic flaw in how SocketDataPump determines if it is safe to shut down.

When evaluating if both the send and receive paths are finished, SocketDataPump::MaybeNotifyDelegate() checks if send_stream_.is_valid() is true:

C++
void SocketDataPump::MaybeNotifyDelegate() {
  if (!delegate_ || send_stream_.is_valid() || !receive_is_shutdown_) {
    return;
  }
  delegate_->OnShutdown();
}

However, this check is insufficient. When SocketDataPump::SendMore() initiates a write, it calls MojoToNetPendingBuffer::BeginRead(), which std::move()s the send_stream_ handle into a pending_send_buffer_. As a result, send_stream_.is_valid() evaluates to false for the entire duration of the socket write operation.

If the socket returns net::ERR_IO_PENDING (e.g., because the OS send buffer is full), the write remains pending asynchronously. If the receive stream is closed during this time, MaybeNotifyDelegate() will incorrectly conclude that the pump is completely idle and call delegate_->OnShutdown().

Attack Scenario

Note: These are potential steps based on code analysis; our tooling agent does not currently have the ability to run a live Proof of Concept.

  1. Connection Setup: An attacker in a compromised renderer with socket access (e.g., a Chrome Extension or an Isolated Web App via Direct Sockets) opens a TCP connection to a malicious server.
  2. Induce a Pending Write: The malicious server refuses to read from the TCP socket, causing the OS send buffer to fill up. The renderer writes a large payload to the socket's Mojo data pipe. The Network Service attempts to write this data, but socket_->Write() returns net::ERR_IO_PENDING.
  3. Trigger Shutdown: The attacker intentionally closes the receive-side Mojo data pipe from the renderer.
  4. Premature Destruction: SocketDataPump::OnReceiveStreamClosed() is triggered, setting receive_is_shutdown_ = true and calling MaybeNotifyDelegate(). Since send_stream_ is currently invalid (held by pending_send_buffer_), the pump incorrectly notifies its delegate (TCPConnectedSocket) to shut down.
  5. Memory Unmapping: TCPConnectedSocket::OnShutdown() destroys the SocketDataPump, which destroys the pending_send_buffer_ and fully closes the Mojo data pipe. The OS unmaps the shared memory backing the pipe.
  6. Dangling Pointer: Crucially, TCPConnectedSocket keeps the underlying net::TransportClientSocket alive (to support potential TLS upgrades). The socket (e.g., SocketPosix) still holds a net::WrappedIOBuffer pointing to the now-unmapped virtual address.
  7. Memory Spray & Exfiltration: The attacker initiates hundreds of cross-origin fetch() requests. The Network Service allocates new Mojo data pipes for the sensitive HTTP responses, and the OS remaps the recently freed virtual address space with this new data.
  8. Data Leak: The malicious server finally reads from the TCP socket, clearing the OS send buffer. The socket becomes writable, and the asynchronous write resumes (e.g., SocketPosix::WriteCompleted calls DoWrite()). The kernel reads from the dangling pointer, silently transmitting the remapped sensitive cross-origin data to the attacker's server.

Mitigation Bypass

Chromium's MiraclePtr (BackupRefPtr) does not protect against this vulnerability because the dangling pointer inside net::WrappedIOBuffer points to mmap'd shared memory (the Mojo data pipe), not memory allocated via PartitionAlloc.

Suggested Fix

Modify SocketDataPump::MaybeNotifyDelegate() to also check if there is an active pending write. For example:

C++
void SocketDataPump::MaybeNotifyDelegate() {
  if (!delegate_ || send_stream_.is_valid() || pending_send_buffer_ || !receive_is_shutdown_) {
    return;
  }
  delegate_->OnShutdown();
}

Alternatively, ensure that TCPConnectedSocket::OnShutdown() or SocketDataPump::~SocketDataPump() explicitly cancels any pending I/O operations on the underlying socket_ before allowing the object to be destroyed or the socket to be repurposed.

Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0


Results from so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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 check for whether the send path is idle only looks at whether the send stream handle is valid, but during a pending write the handle is moved into a pending buffer, making the check falsely report idle.

Impact

An attacker could potentially cause the socket to send remapped sensitive cross-origin data to an attacker-controlled server, but the report notes these are potential steps based on code analysis and no live proof of concept was run.

What the attacker needed

Compromised renderer with socket access; attacker-controlled server; ability to close receive-side pipe

The fix

The fix should modify SocketDataPump::MaybeNotifyDelegate() to also check for an active pending write, or ensure that pending I/O operations are explicitly cancelled before destruction.

How it was found

  1. An attacker in a compromised renderer with socket access opens a TCP connection to a malicious server.
  2. The malicious server refuses to read from the TCP socket, causing the OS send buffer to fill up; the renderer writes a large payload, and the Network Service's write returns net::ERR_IO_PENDING.
  3. The attacker intentionally closes the receive-side Mojo data pipe from the renderer.
  4. SocketDataPump::OnReceiveStreamClosed() sets receive_is_shutdown_ = true and calls MaybeNotifyDelegate(), which incorrectly notifies the delegate to shut down because send_stream_ is invalid.
  5. TCPConnectedSocket::OnShutdown() destroys the SocketDataPump, unmapping the shared memory backing the Mojo data pipe, while the underlying socket retains a dangling pointer.
  6. The attacker initiates hundreds of cross-origin fetch() requests to remap the freed memory with sensitive data, then the malicious server reads from the TCP socket, causing the pending write to resume and send the remapped data to the…

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.

This report describes a memory safety bug in Chrome's network code. When a program frees memory but keeps a pointer to it, that pointer can later be used to read or write data that has been replaced by something else. Here, a socket write operation is left pointing to memory that gets reused for sensitive data, which could then be sent to an attacker.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.