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

Use after free Network (CVE-2026-12012)

A use-after-free vulnerability in Chrome's SPDY buffer handling allows a malicious HTTP/2 proxy to trigger reentrant stream closure, freeing a buffer while its callbacks are being iterated. This could lead to remote code execution in the network process.

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. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the security team.

Overview: A potential Use-After-Free vulnerability exists in SpdyBuffer::ConsumeHelper due to a reentrant call to SpdyReadQueue::Dequeue during stream closure. An attacker controlling an HTTP/2 proxy server can trigger this reentrancy, freeing the SpdyBuffer while its consume_callbacks_ are being iterated, potentially leading to Remote Code Execution.

Affected files:

  • net/spdy/spdy_buffer.cc
  • net/spdy/spdy_read_queue.cc
  • net/spdy/spdy_proxy_client_socket.cc
  • net/spdy/spdy_session.cc

Estimated timestamp from git blame: 2025-07-01

Description

A potential Use-After-Free (UAF) vulnerability exists in the Chrome network stack, specifically within SpdyBuffer::ConsumeHelper in net/spdy/spdy_buffer.cc. The issue arises because ConsumeHelper iterates over its consume_callbacks_ vector and executes callbacks synchronously without a reentrancy guard or protection against the SpdyBuffer instance being destroyed mid-iteration.

Technical Analysis & Suggested Reproduction Steps

This vulnerability can be triggered via a reentrancy path through SpdyProxyClientSocket when handling incoming data from a malicious HTTP/2 proxy server.

An attacker could potentially trigger this by following these steps:

  1. Establish Proxy Connection: Set up a malicious HTTP/2 proxy server and establish a proxy connection with Chrome, creating a SpdyProxyClientSocket and a SpdyStream.
  2. Initiate Read: Wait for Chrome's TLS stack or consumer to issue a read request via SpdyProxyClientSocket::Read. The socket saves the user_buffer_ (size N) and read_callback_.
  3. Saturate Write Queue: Advertise a TCP window of 0 to block Chrome from writing, and send 10,000 HTTP/2 PING frames. This fills the SpdySession's write_queue_ with capped PING ACK frames until it reaches session_max_queued_capped_frames_ (10,000).
  4. Send Malicious DATA Frame: Send a single DATA frame with a payload size P chosen such that N < P ≤ 2N.
  5. Process Data: Chrome receives the DATA frame, wraps it in a SpdyBuffer, adds a SpdyStream::OnReadBufferConsumed callback, and passes it to SpdyProxyClientSocket::OnDataReceived.
  6. Outer Dequeue & Consume: Because read_callback_ is set, OnDataReceived calls PopulateUserReadBuffer → SpdyReadQueue::Dequeue. Since P > N, Dequeue partially consumes the buffer by copying N bytes and calling buffer->Consume(N), leaving the buffer at the front of the queue.
  7. Callback Execution: SpdyBuffer::Consume calls ConsumeHelper, which enters a for loop over consume_callbacks_. It executes the first callback: SpdyStream::OnReadBufferConsumed.
  8. Trigger Session Drain: OnReadBufferConsumed updates the receive window, triggering SpdySession::SendStreamWindowUpdate → EnqueueSessionWrite. Because the write queue is already full of PING ACKs (10,000 frames), the additional WINDOW_UPDATE frame exceeds the limit (10,001), triggering SpdySession::DoDrainSession.
  9. Synchronous Stream Closure: DoDrainSession synchronously closes all streams, calling SpdyStream::OnClose(status), which invokes its delegate, SpdyProxyClientSocket::OnClose.
  10. Reentrant OnDataReceived: Inside SpdyProxyClientSocket::OnClose, since read_callback_ is not null (the outer OnDataReceived hasn't cleared it yet), it synchronously calls OnDataReceived(nullptr).
  11. Inner Dequeue & Buffer Free: The inner OnDataReceived sees user_buffer_ is still set and calls PopulateUserReadBuffer → SpdyReadQueue::Dequeue again, with the same size N. The remaining size of the front SpdyBuffer is P - N. Because P ≤ 2N, the remaining size is ≤ N. Dequeue copies the remaining data and executes queue_.pop_front(), destroying the SpdyBuffer object and freeing its memory.
  12. Synchronous Heap Spray: The inner OnDataReceived finishes and executes std::move(read_callback_).Run(rv). The attacker's P - N bytes are passed to the consumer (e.g., the TLS stack). If these bytes are carefully crafted TLS records, they can be used to perform a synchronous, targeted heap spray during the callback execution, reclaiming the freed SpdyBuffer and its std::vector backing store.
  13. Use-After-Free Read & Execution: The call stack unwinds back to the outer SpdyBuffer::ConsumeHelper for loop. The this pointer is now dangling. The loop reads the end() iterator from the attacker-controlled reclaimed memory. The loop continues and calls it->Run(), executing a hijacked function pointer from a fake base::RepeatingCallback object injected during the heap spray.

(Note: These are suggested steps based on source code analysis; our agent does not yet have the ability to run code to confirm a working exploit).

Impact

If successfully exploited, this vulnerability could allow an attacker to achieve arbitrary Remote Code Execution (RCE) in the Network Process. MiraclePtr does not mitigate this issue because the dangling references involve the this pointer and internal std::vector iterators rather than raw_ptr members.

Suggested Fix

There are a few potential ways to resolve this:

  1. PostTask for Callbacks: Instead of executing the consume callbacks synchronously in SpdyBuffer::ConsumeHelper, post them to the thread's task runner. This ensures the callbacks run after the current stack unwinds, preventing synchronous reentrancy.
  2. Clear Socket State Earlier: In SpdyProxyClientSocket::OnDataReceived, clear read_callback_, user_buffer_, and user_buffer_len_ before calling PopulateUserReadBuffer. This breaks the reentrancy loop by ensuring the inner OnClose call does not see a pending read state.
  3. Reentrancy Guard: Add a bool is_consuming_ flag to SpdyBuffer to detect and block or queue reentrant consumes.

Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33


Results 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 code iterates over callbacks without guarding against reentrancy, allowing the buffer to be destroyed mid-iteration.

Impact

If successfully exploited, this vulnerability could allow an attacker to achieve arbitrary Remote Code Execution (RCE) in the Network Process.

What the attacker needed

Malicious HTTP/2 proxy server; victim connects through the proxy

The fix

The report suggests posting callbacks asynchronously, clearing socket state earlier, or adding a reentrancy guard; it does not state that a fix was applied.

How it was found

  1. Set up a malicious HTTP/2 proxy server and establish a proxy connection with Chrome.
  2. Wait for Chrome to issue a read request, saving the user buffer and callback.
  3. Advertise a TCP window of 0 and send 10,000 PING frames to fill the write queue.
  4. Send a DATA frame with payload size P such that N < P ≤ 2N.
  5. Chrome processes the DATA frame, partially consumes the buffer, and triggers a callback that drains the session.
  6. The session closure reentrantly calls OnDataReceived, which frees the buffer, and then a heap spray reclaims it, leading to use-after-free.

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 use-after-free happens when a program frees memory but then keeps using it, like deleting a file and then trying to open it. Here, a malicious proxy server can trick Chrome into freeing a buffer while it is still processing callbacks, and then the attacker can fill that memory with controlled data. This could let the attacker run their own code inside Chrome's network process.

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.