Use after free in GPU (CVE-2026-7333)
A heap use-after-free in the Viz compositor process occurs when a vector of allocation group pointers is mutated during iteration, causing dangling iterators. A compromised renderer can trigger this via Mojo interfaces, leading to a crash outside the sandbox.
c6eed09fc8b174b0f3eebedcceb1e792 Follow
Originally disclosed on Chrome VRP
- Fix shipped in 41 days
Reentrant vector mutation during FrameSink invalidation causes heap use-after-free in Viz process
Summary
A heap use-after-free vulnerability exists in the Viz compositor process on all desktop platforms (Linux, macOS, Windows, ChromeOS). SurfaceManager::InvalidateFrameSinkId() iterates a vector of SurfaceAllocationGroup pointers using a range-for loop. During iteration, the synchronous callback chain through WillNotRegisterNewSurfaces can activate a pending surface whose referenced_surfaces metadata triggers creation of new allocation groups via push_back into the same vector. When the vector reallocates its internal buffer, the range-for loop's captured iterators become dangling, and subsequent iterations read freed heap memory. A compromised renderer can construct the necessary state entirely through the EmbeddedFrameSinkProvider and CompositorFrameSink Mojo interfaces and trigger the invalidation by closing a connection. The crash occurs on the VizCompositorThread, which runs outside the renderer sandbox. ASAN confirms the region is not protected by MiraclePtr.
Bisect
Introducing Commit: 9ef8b6ebe397e7a492210006d949423ba27f5acd
- Date: 2019-04-05
- Author: Saman Sami <[email protected]>
- Review: https://chromium-review.googlesource.com/c/chromium/src/+/1539860
Root Cause
SurfaceManager::InvalidateFrameSinkId looks up all SurfaceAllocationGroup entries associated with a given FrameSinkId and notifies each that no further surfaces will be registered:
// components/viz/service/surfaces/surface_manager.cc:166-174
void SurfaceManager::InvalidateFrameSinkId(const FrameSinkId& frame_sink_id) {
auto it = frame_sink_id_to_allocation_groups_.find(frame_sink_id);
if (it != frame_sink_id_to_allocation_groups_.end()) {
for (SurfaceAllocationGroup* group : it->second) {
group->WillNotRegisterNewSurfaces();
}
}
GarbageCollectSurfaces();
}
The range-for loop captures begin() and end() iterators of it->second, a std::vector<raw_ptr<SurfaceAllocationGroup, VectorExperimental>>. These iterators point into the vector's internal heap buffer.
WillNotRegisterNewSurfaces moves out all blocked embedders and synchronously resolves their activation dependencies:
// components/viz/service/surfaces/surface_allocation_group.cc:176-182
void SurfaceAllocationGroup::WillNotRegisterNewSurfaces() {
base::flat_map<Surface*, SurfaceId> embedders = std::move(blocked_embedders_);
blocked_embedders_.clear();
for (const auto& entry : embedders) {
entry.first->OnActivationDependencyResolved(entry.second, this);
}
}
If the resolved dependency was the last outstanding one for a surface, OnActivationDependencyResolved calls ActivatePendingFrame, which calls ActivateFrame, which calls RecomputeActiveReferencedSurfaces. That function iterates the activated frame's referenced_surfaces metadata and calls GetOrCreateAllocationGroupForSurfaceId for each entry:
// components/viz/service/surfaces/surface_manager.cc:656-661
if (!allocation_group) {
allocation_group = std::make_unique<SurfaceAllocationGroup>(
this, surface_id.frame_sink_id(),
surface_id.local_surface_id().embed_token());
frame_sink_id_to_allocation_groups_[surface_id.frame_sink_id()].push_back(
allocation_group.get());
}
When surface_id.frame_sink_id() matches the FrameSinkId currently being invalidated, push_back appends to the same vector that InvalidateFrameSinkId is iterating. If the vector's capacity is exceeded, it reallocates its internal buffer, freeing the old one. The range-for loop then advances its stale iterator into the freed buffer, reading a dangling SurfaceAllocationGroup* pointer.
A compromised renderer can construct this state through normal Mojo interfaces. It creates a target FrameSink X and three attacker FrameSinks via blink.mojom.EmbeddedFrameSinkProvider.CreateSimpleCompositorFrameSink. Each attacker submits a CompositorFrame with one activation_dependency referencing X (using distinct embed tokens E1, E2, E3), which creates three allocation groups in the vector for X. The first attacker's frame additionally carries 200 referenced_surfaces entries, each referencing X with a unique embed token. These entries are inert while the frame is pending. When the renderer closes X's EmbeddedFrameSinkClient connection, the browser forwards an InvalidateFrameSinkId(X) call to the Viz process. The loop processes E1's group first, resolving the first attacker surface's sole dependency, activating its pending frame, and processing 200 referenced_surfaces entries. Each entry calls GetOrCreateAllocationGroupForSurfaceId, which push_backs a new group into the vector for X. The vector grows from 3 elements to over 200, reallocating its buffer. The next loop iteration dereferences the stale iterator into the freed 3-element buffer.
No mitigations block this path. There are no CHECK guards on the iteration, no reentrancy protection, and no copy of the vector before iteration. The raw_ptr<VectorExperimental> wrapper on the vector elements protects the pointed-to SurfaceAllocationGroup objects but does not protect the vector's own internal buffer from iterator invalidation. The mojom deserialization in compositor_frame_metadata_mojom_traits.cc imposes no restrictions on the number or content of referenced_surfaces or activation_dependencies. ASAN confirms "MiraclePtr Status: NOT PROTECTED" for this access.
Reproduce
Tested at commit 7c89d33808e551aed6122c1f324864784011c158.
Apply the attached patch.diff to the renderer source, then build:
git apply issue_framesink_invalidation_uaf/patch.diff
autoninja -C ~/chromium/src/out/asan-release chrome
Launch and open poc.html:
ASAN_OPTIONS=detect_odr_violation=0 xvfb-run -a \
~/chromium/src/out/asan-release/chrome \
--user-data-dir=/tmp/poc-$(date +%s) \
issue_framesink_invalidation_uaf/poc.html
The GPU/Viz process crashes with a heap-use-after-free within approximately one second. The crash occurs on the VizCompositorThread inside SurfaceManager::InvalidateFrameSinkId.
==2458553==ERROR: AddressSanitizer: heap-use-after-free on address 0x7b2e9da4f4c8 at pc 0x7efea76d1825 bp 0x7afe82a9eb30 sp 0x7afe82a9eb28
READ of size 8 at 0x7b2e9da4f4c8 thread T15 (VizCompositorTh)
#0 0x7efea76d1824 in viz::SurfaceManager::InvalidateFrameSinkId(viz::FrameSinkId const&) base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h:1018:47
#1 0x7efea75774b5 in viz::FrameSinkManagerImpl::InvalidateFrameSinkId(viz::FrameSinkId const&, base::OnceCallback<void ()>) components/viz/service/frame_sinks/frame_sink_manager_impl.cc:223:20
#2 0x7efea77696ae in viz::mojom::FrameSinkManagerStubDispatch::AcceptWithResponder(viz::mojom::FrameSinkManager*, mojo::Message*, std::__Cr::unique_ptr<mojo::MessageReceiverWithStatus, std::__Cr::default_delete<mojo::MessageReceiverWithStatus>>) gen/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom.cc:3271:13
0x7b2e9da4f4c8 is located 8 bytes inside of 32-byte region [0x7b2e9da4f4c0,0x7b2e9da4f4e0)
freed by thread T15 (VizCompositorTh) here:
#0 0x5596ce120b02 in operator delete(void*, unsigned long)
#1 0x7efea76db70d in std::__Cr::vector<...>::__emplace_back_slow_path gen/third_party/libc++/src/include/__new/allocate.h:63:10
#2 0x7efea76cfed8 in viz::SurfaceManager::GetOrCreateAllocationGroupForSurfaceId(viz::SurfaceId const&) gen/third_party/libc++/src/include/__vector/vector.h:1148:21
#3 0x7efea76a888f in viz::Surface::RecomputeActiveReferencedSurfaces() components/viz/service/surfaces/surface.cc:634:27
#4 0x7efea76ad04e in viz::Surface::ActivateFrame(viz::Surface::FrameData) components/viz/service/surfaces/surface.cc:697:3
#5 0x7efea76a7df9 in viz::Surface::ActivatePendingFrame() components/viz/service/surfaces/surface.cc:520:3
#6 0x7efea76af659 in viz::Surface::OnActivationDependencyResolved(viz::SurfaceId const&, viz::SurfaceAllocationGroup*) components/viz/service/surfaces/surface.cc:459:3
#7 0x7efea76cb544 in viz::SurfaceAllocationGroup::WillNotRegisterNewSurfaces() components/viz/service/surfaces/surface_allocation_group.cc:180:18
#8 0x7efea76d1781 in viz::SurfaceManager::InvalidateFrameSinkId(viz::FrameSinkId const&) components/viz/service/surfaces/surface_manager.cc:170:14
previously allocated by thread T15 (VizCompositorTh) here:
#0 0x5596ce11fefd in operator new(unsigned long)
#1 0x7efea76db5e4 in std::__Cr::vector<...>::__emplace_back_slow_path gen/third_party/libc++/src/include/__new/allocate.h:43:28
#2 0x7efea76cfed8 in viz::SurfaceManager::GetOrCreateAllocationGroupForSurfaceId(viz::SurfaceId const&) gen/third_party/libc++/src/include/__vector/vector.h:1148:21
#3 0x7efea76ac1d6 in viz::Surface::UpdateActivationDependencies(viz::CompositorFrame const&) components/viz/service/surfaces/surface.cc:802:27
#4 0x7efea76aab53 in viz::Surface::CommitFrame(viz::Surface::FrameData) components/viz/service/surfaces/surface.cc:343:3
#5 0x7efea76a9e4a in viz::Surface::QueueFrame(viz::CompositorFrame, unsigned int, base::ScopedClosureRunner) components/viz/service/surfaces/surface.cc:270:14
#6 0x7efea7541176 in viz::CompositorFrameSinkSupport::MaybeSubmitCompositorFrame components/viz/service/frame_sinks/compositor_frame_sink_support.cc:1014:55
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.
The complete ASAN log is in asan.log.
Credit
Please use c6eed09fc8b174b0f3eebedcceb1e792 as the credit for this vulnerability. Thank you.
Context
This report describes a heap use-after-free in the Viz compositor process of Chromium, the component that composites surfaces on behalf of renderers. The affected code lives in components/viz/service/surfaces/, specifically in SurfaceManager and SurfaceAllocationGroup. The bug is tracked as CVE-2026-7333, was reported through the Chrome VRP, and was disclosed on 2026-04-28 with a bounty of 16,000 USD and a severity of high. The researcher is credited as [redacted].
The feature involved is the allocation group bookkeeping that Viz keeps for each FrameSinkId. When a frame sink is torn down, SurfaceManager::InvalidateFrameSinkId() walks the vector of SurfaceAllocationGroup pointers registered for that frame sink and tells each group that no further surfaces will be registered. The report shows that this walk can be re-entered, that the re-entry can grow the very vector being walked, and that the resulting reallocation leaves the loop with dangling iterators.
The report states the bug affects all desktop platforms: Linux, macOS, Windows and ChromeOS. The crash happens on the VizCompositorThread, which the report notes runs outside the renderer sandbox.
Setup
The researcher bisected the introducing commit and reproduced the crash at a specific revision. The report gives the following details.
Introducing commit: [redacted], dated 2019-04-05, authored by Saman Sami, with review link https://chromium-review.googlesource.com/c/chromium/src/+/1539860.
Reproduction revision: [redacted].
The reproduction requires a patched renderer build. The report says to apply the attached patch.diff to the renderer source and then build an ASAN release binary:
git apply issue_framesink_invalidation_uaf/patch.diff
autoninja -C ~/chromium/src/out/asan-release chrome
The proof of concept is a file named poc.html, launched under Xvfb with ASAN configured to ignore ODR violations:
ASAN_OPTIONS=detect_odr_violation=0 xvfb-run -a \
~/chromium/src/out/asan-release/chrome \
--user-data-dir=/tmp/poc-$(date +%s) \
issue_framesink_invalidation_uaf/poc.html
The report says the GPU/Viz process crashes with a heap-use-after-free within approximately one second, on the VizCompositorThread inside SurfaceManager::InvalidateFrameSinkId. The full ASAN log is said to be in asan.log; the report reproduces the key portion inline.
The attacker model is a compromised renderer. The report states that such a renderer can construct the necessary state entirely through the EmbeddedFrameSinkProvider and CompositorFrameSink Mojo interfaces, and trigger the invalidation by closing a connection. No user interaction beyond loading the page is described.
Finding it
The researcher identified a reentrancy problem in SurfaceManager::InvalidateFrameSinkId. The function iterates a vector of allocation group pointers with a range-for loop. Inside the loop body it calls WillNotRegisterNewSurfaces() on each group. That call is not a leaf: it synchronously resolves activation dependencies, which can activate a pending surface, which recomputes the active referenced surfaces, which can create new allocation groups and push_back them into the same vector. If the vector reallocates, the loop's captured iterators point into freed memory.
The report frames this as a reentrant vector mutation during FrameSink invalidation. The key observation is that the callback chain from WillNotRegisterNewSurfaces back into GetOrCreateAllocationGroupForSurfaceId is synchronous and can target the same FrameSinkId that is currently being invalidated.
Exploitation
The report describes the construction at the level of Mojo interfaces and frame metadata rather than giving literal message bytes. The steps below follow the report's description exactly; where the report does not give a concrete payload, none is invented here.
Step 1: create the target frame sink and three attacker frame sinks
The compromised renderer creates a target FrameSink X and three attacker FrameSinks through blink.mojom.EmbeddedFrameSinkProvider.CreateSimpleCompositorFrameSink. The report does not give the literal Mojo message contents.
Step 2: submit frames with activation dependencies on X
Each of the three attacker frame sinks submits a CompositorFrame carrying one activation_dependency that references X. The three use distinct embed tokens E1, E2 and E3. This creates three allocation groups in the vector for X.
Step 3: attach 200 referenced surfaces to the first attacker's frame
The first attacker's frame additionally carries 200 referenced_surfaces entries, each referencing X with a unique embed token. The report notes these entries are inert while the frame is pending.
Step 4: close the target's client connection to trigger invalidation
The renderer closes X's EmbeddedFrameSinkClient connection. The browser then forwards an InvalidateFrameSinkId(X) call to the Viz process.
Step 5: the loop re-enters and reallocates the vector
The loop processes E1's group first. Resolving the first attacker surface's sole dependency activates its pending frame, and RecomputeActiveReferencedSurfaces processes the 200 referenced_surfaces entries. Each entry calls GetOrCreateAllocationGroupForSurfaceId, which push_backs a new group into the vector for X. The vector grows from 3 elements to over 200 and reallocates its buffer. The next loop iteration dereferences the stale iterator into the freed 3-element buffer.
Step 6: observe the ASAN crash
The report gives the following ASAN output, which shows the read in InvalidateFrameSinkId, the free in the vector growth path reached through RecomputeActiveReferencedSurfaces, and the earlier allocation through UpdateActivationDependencies:
==2458553==ERROR: AddressSanitizer: heap-use-after-free on address 0x7b2e9da4f4c8 at pc 0x7efea76d1825 bp 0x7afe82a9eb30 sp 0x7afe82a9eb28
READ of size 8 at 0x7b2e9da4f4c8 thread T15 (VizCompositorTh)
#0 0x7efea76d1824 in viz::SurfaceManager::InvalidateFrameSinkId(viz::FrameSinkId const&) base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h:1018:47
#1 0x7efea75774b5 in viz::FrameSinkManagerImpl::InvalidateFrameSinkId(viz::FrameSinkId const&, base::OnceCallback<void ()>) components/viz/service/frame_sinks/frame_sink_manager_impl.cc:223:20
#2 0x7efea77696ae in viz::mojom::FrameSinkManagerStubDispatch::AcceptWithResponder(viz::mojom::FrameSinkManager*, mojo::Message*, std::__Cr::unique_ptr<mojo::MessageReceiverWithStatus, std::__Cr::default_delete<mojo::MessageReceiverWithStatus>>) gen/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom.cc:3271:13
0x7b2e9da4f4c8 is located 8 bytes inside of 32-byte region [0x7b2e9da4f4c0,0x7b2e9da4f4e0)
freed by thread T15 (VizCompositorTh) here:
#0 0x5596ce120b02 in operator delete(void*, unsigned long)
#1 0x7efea76db70d in std::__Cr::vector<...>::__emplace_back_slow_path gen/third_party/libc++/src/include/__new/allocate.h:63:10
#2 0x7efea76cfed8 in viz::SurfaceManager::GetOrCreateAllocationGroupForSurfaceId(viz::SurfaceId const&) gen/third_party/libc++/src/include/__vector/vector.h:1148:21
#3 0x7efea76a888f in viz::Surface::RecomputeActiveReferencedSurfaces() components/viz/service/surfaces/surface.cc:634:27
#4 0x7efea76ad04e in viz::Surface::ActivateFrame(viz::Surface::FrameData) components/viz/service/surfaces/surface.cc:697:3
#5 0x7efea76a7df9 in viz::Surface::ActivatePendingFrame() components/viz/service/surfaces/surface.cc:520:3
#6 0x7efea76af659 in viz::Surface::OnActivationDependencyResolved(viz::SurfaceId const&, viz::SurfaceAllocationGroup*) components/viz/service/surfaces/surface.cc:459:3
#7 0x7efea76cb544 in viz::SurfaceAllocationGroup::WillNotRegisterNewSurfaces() components/viz/service/surfaces/surface_allocation_group.cc:180:18
#8 0x7efea76d1781 in viz::SurfaceManager::InvalidateFrameSinkId(viz::FrameSinkId const&) components/viz/service/surfaces/surface_manager.cc:170:14
previously allocated by thread T15 (VizCompositorTh) here:
#0 0x5596ce11fefd in operator new(unsigned long)
#1 0x7efea76db5e4 in std::__Cr::vector<...>::__emplace_back_slow_path gen/third_party/libc++/src/include/__new/allocate.h:43:28
#2 0x7efea76cfed8 in viz::SurfaceManager::GetOrCreateAllocationGroupForSurfaceId(viz::SurfaceId const&) gen/third_party/libc++/src/include/__vector/vector.h:1148:21
#3 0x7efea76ac1d6 in viz::Surface::UpdateActivationDependencies(viz::CompositorFrame const&) components/viz/service/surfaces/surface.cc:802:27
#4 0x7efea76aab53 in viz::Surface::CommitFrame(viz::Surface::FrameData) components/viz/service/surfaces/surface.cc:343:3
#5 0x7efea76a9e4a in viz::Surface::QueueFrame(viz::CompositorFrame, unsigned int, base::ScopedClosureRunner) components/viz/service/surfaces/surface.cc:270:14
#6 0x7efea7541176 in viz::CompositorFrameSinkSupport::MaybeSubmitCompositorFrame components/viz/service/frame_sinks/compositor_frame_sink_support.cc:1014:55
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.
The ASAN output shows a read of size 8, a 32-byte freed region, and the read landing 8 bytes inside it. The report also notes that the crash is still exploitable with MiraclePtr.
Root cause
The report gives the relevant code. SurfaceManager::InvalidateFrameSinkId looks up the allocation groups for a FrameSinkId and iterates them:
// components/viz/service/surfaces/surface_manager.cc:166-174
void SurfaceManager::InvalidateFrameSinkId(const FrameSinkId& frame_sink_id) {
auto it = frame_sink_id_to_allocation_groups_.find(frame_sink_id);
if (it != frame_sink_id_to_allocation_groups_.end()) {
for (SurfaceAllocationGroup* group : it->second) {
group->WillNotRegisterNewSurfaces();
}
}
GarbageCollectSurfaces();
}
The range-for loop captures begin() and end() iterators of it->second, a std::vector<raw_ptr<SurfaceAllocationGroup, VectorExperimental>>. Those iterators point into the vector's internal heap buffer.
WillNotRegisterNewSurfaces moves out the blocked embedders and synchronously resolves their activation dependencies:
// components/viz/service/surfaces/surface_allocation_group.cc:176-182
void SurfaceAllocationGroup::WillNotRegisterNewSurfaces() {
base::flat_map<Surface*, SurfaceId> embedders = std::move(blocked_embedders_);
blocked_embedders_.clear();
for (const auto& entry : embedders) {
entry.first->OnActivationDependencyResolved(entry.second, this);
}
}
If the resolved dependency was the last outstanding one for a surface, OnActivationDependencyResolved calls ActivatePendingFrame, which calls ActivateFrame, which calls RecomputeActiveReferencedSurfaces. That function iterates the activated frame's referenced_surfaces metadata and calls GetOrCreateAllocationGroupForSurfaceId for each entry:
// components/viz/service/surfaces/surface_manager.cc:656-661
if (!allocation_group) {
allocation_group = std::make_unique<SurfaceAllocationGroup>(
this, surface_id.frame_sink_id(),
surface_id.local_surface_id().embed_token());
frame_sink_id_to_allocation_groups_[surface_id.frame_sink_id()].push_back(
allocation_group.get());
}
When surface_id.frame_sink_id() matches the FrameSinkId being invalidated, push_back appends to the same vector that InvalidateFrameSinkId is iterating. If capacity is exceeded, the buffer is reallocated and the old one freed. The range-for loop then advances its stale iterator into the freed buffer and reads a dangling SurfaceAllocationGroup*.
The report lists the defences that do not stop this path. There are no CHECK guards on the iteration, no reentrancy protection, and no copy of the vector before iteration. The raw_ptr<VectorExperimental> wrapper on the elements protects the pointed-to SurfaceAllocationGroup objects but not the vector's own internal buffer from iterator invalidation. The mojom deserialisation in compositor_frame_metadata_mojom_traits.cc imposes no restrictions on the number or content of referenced_surfaces or activation_dependencies. ASAN reports MiraclePtr Status: NOT PROTECTED for the access.
Impact
The report describes a heap use-after-free in the Viz process, reachable by a compromised renderer through normal Mojo interfaces. The crash occurs on the VizCompositorThread, which the report notes runs outside the renderer sandbox. It states that the crash is still exploitable with MiraclePtr, which is relevant because MiraclePtr is a mitigation against use-after-free in Chromium. The severity recorded by the platform is high, with a bounty of 16,000 USD.
The conditions are that the attacker controls a renderer and can create frame sinks and submit compositor frames through the described interfaces, and that the target frame sink's invalidation is triggered by closing the client connection. The report lists the affected desktop platforms and does not mention GPU or driver requirements.
Fix
It identifies the introducing commit and the reproduction revision, and it describes the missing protections (no CHECK guards, no reentrancy protection, no copy of the vector before iteration). A fix would need to prevent the vector from being mutated during iteration, for example by copying the vector before iterating or by deferring the creation of new allocation groups until after the loop.
Variants to test
The report's mechanism suggests several concrete things to try on other targets. Each is stated with what a positive result would look like.
- Other range-for loops over containers that are mutated by synchronous callbacks. Look for loops in compositor, IPC and service code where the loop body calls into code that can
push_backinto the same container. A positive result is an ASAN heap-use-after-free report whose free stack shows the container growth path and whose read stack shows the loop. - Other invalidation paths that resolve pending state synchronously. Look for functions named like
Invalidate*,WillNot*,On*Resolvedthat call into activation or dependency resolution. A positive result is a reentrant call that reaches the same container being iterated. - Metadata fields with no deserialisation limits. The report notes that
compositor_frame_metadata_mojom_traits.ccimposes no restrictions on the number or content ofreferenced_surfacesoractivation_dependencies. Try large counts of these fields on other frame metadata paths. A positive result is a crash or a measurable resource effect that the receiver does not bound. raw_ptrwrappers on container elements. The report shows that protecting the pointed-to objects does not protect the container's buffer. Look for otherstd::vector<raw_ptr<...>>members that are iterated while callbacks run. A positive result is an ASAN report withMiraclePtr Status: NOT PROTECTEDon the container buffer.- Connection close as a trigger. The report triggers invalidation by closing an
EmbeddedFrameSinkClientconnection. Try closing other client connections that lead to synchronous teardown of shared state. A positive result is a crash on the service thread outside the renderer sandbox.
What happened, in plain words
A web browser is not one program. It is a collection of programs that talk to each other. One of those programs draws what you see on screen. In Chrome and other browsers built on Chromium, that drawing program is called the compositor, and the part of it that handles the drawing work is called Viz. Viz runs in its own process, separate from the web page. That separation is deliberate: if a web page misbehaves, the browser wants the damage to stay inside the page's process, not spread to the part that draws everything.
This report describes a bug in Viz. A web page that has already been taken over by an attacker (a compromised renderer) can send Viz a carefully arranged set of drawing instructions. When the page then closes one of its connections, Viz walks through a list of internal records, and during that walk it accidentally adds new records to the very list it is walking. The list runs out of room, moves itself to a new place in memory, and frees the old place. The walk keeps going using directions to the old place, which no longer exists. That is a use-after-free: the program reads memory it has already given back.
The crash happens in Viz, which the report says runs outside the renderer sandbox. The bug is tracked as CVE-2026-7333, was reported through the Chrome VRP (Chrome's bug bounty programme), was rated high severity, paid a bounty of 16,000 USD, and was disclosed on 2026-04-28. The researcher is credited as [redacted].
A few words before we start, because they come up constantly:
- A process is a running program with its own private memory. Two processes cannot read each other's memory unless the operating system explicitly allows it.
- A sandbox is a set of restrictions around a process. A sandboxed process is allowed to do very little, so that if an attacker gets control of it, they still cannot do much.
- Memory here means the computer's working memory (RAM). Programs ask the operating system for chunks of it and give chunks back when done.
- A pointer is a number that says where in memory something lives. It is like a house address. If the house is demolished and you still use the address, you are reading a use-after-free.
- An API is a defined way for one program to ask another program to do something. It is like a restaurant menu: you can only order what is on it, in the form the kitchen expects.
- Mojo is Chromium's internal API system. It is how the browser's processes send typed messages to each other.
- A frame sink is Viz's name for a place that frames (pictures) can be submitted to. Think of it as a mailbox with an ID.
- A frame (or CompositorFrame) is one picture plus some notes about it, such as what it depends on and what it refers to.
Context
This report describes a heap use-after-free in the Viz compositor process of Chromium, the component that composites surfaces on behalf of renderers. The affected code lives in components/viz/service/surfaces/, specifically in SurfaceManager and SurfaceAllocationGroup. The bug is tracked as CVE-2026-7333, was reported through the Chrome VRP, and was disclosed on 2026-04-28 with a bounty of 16,000 USD and a severity of high. The researcher is credited as [redacted].
Let us unpack that paragraph.
- Compositing means stacking layers of a page into the final picture you see. The browser does not redraw everything from scratch every time something moves; it keeps layers and combines them. Viz is the part that does this combining.
- A renderer is the process that runs a web page's code (HTML, JavaScript, and so on). It tells Viz what to draw.
- The heap is the general-purpose pool of memory a program uses for objects it creates while running. A heap use-after-free means an object in that pool was freed and then read anyway.
- A CVE is a public identifier for a known vulnerability. It lets everyone refer to the same bug unambiguously.
- A bounty is money paid to a researcher who reports a bug responsibly instead of abusing it.
- Severity high is a rating of how serious the bug is.
The feature involved is the allocation group bookkeeping that Viz keeps for each FrameSinkId. When a frame sink is torn down, SurfaceManager::InvalidateFrameSinkId() walks the vector of SurfaceAllocationGroup pointers registered for that frame sink and tells each group that no further surfaces will be registered. The report shows that this walk can be re-entered, that the re-entry can grow the very vector being walked, and that the resulting reallocation leaves the loop with dangling iterators.
More unpacking:
- A FrameSinkId is the unique name of a frame sink. It is like a mailbox number.
- An allocation group is a bookkeeping record that Viz keeps to track which surfaces belong together for a given frame sink. Think of it as a folder in a filing cabinet, one folder per group of related pictures.
- A vector is a growable list. In C++ (the language Chromium is written in), a
std::vectorstores its items in one contiguous block of memory. When you add an item and the block is full, the vector asks for a bigger block, copies everything over, and frees the old block. That is called reallocation. - An iterator is a cursor that walks through a container. In a vector, an iterator is effectively a pointer into the vector's block of memory. If the block moves, the iterator still points at the old block.
- Dangling means pointing at something that no longer exists.
- Re-entered means a function was called again while it was still running, from inside itself, indirectly. Imagine a shop assistant serving you, who calls the stockroom, and the stockroom calls the assistant back before the first conversation is finished. If the assistant was holding a list of items to fetch, and the stockroom call changes that list, the assistant's place in the list may no longer make sense.
The report states the bug affects all desktop platforms: Linux, macOS, Windows and ChromeOS. The crash happens on the VizCompositorThread, which the report notes runs outside the renderer sandbox.
- A thread is a stream of execution inside a process. A process can have several threads running at once. The VizCompositorThread is the thread inside Viz that does the compositing work.
- Outside the renderer sandbox means the crash happens in a process that is not the tightly restricted page process. That matters because a crash there is closer to the rest of the browser.
Setup
The researcher bisected the introducing commit and reproduced the crash at a specific revision. The report gives the following details.
- Bisect means searching through the history of a codebase to find the exact change that introduced a bug. It is like finding the day a leak started by checking the water meter each week.
- A commit is a saved change to the code, with an identifier, a date and an author.
- A revision is a specific snapshot of the codebase.
Introducing commit: [redacted], dated 2019-04-05, authored by Saman Sami, with review link https://chromium-review.googlesource.com/c/chromium/src/+/1539860.
That is the change that first brought the bug into the code, back in 2019. The review link is where the change was discussed and approved at the time.
Reproduction revision: [redacted].
That is the snapshot of the code the researcher actually tested against.
The reproduction requires a patched renderer build. The report says to apply the attached patch.diff to the renderer source and then build an ASAN release binary:
git apply issue_framesink_invalidation_uaf/patch.diff
autoninja -C ~/chromium/src/out/asan-release chrome
Line by line:
git apply issue_framesink_invalidation_uaf/patch.difftakes a file of code changes (patch.diff) and applies it to the source tree.gitis the version control tool;applymeans "make these edits". The report says to apply the attached patch to the renderer source before building.autoninja -C ~/chromium/src/out/asan-release chromebuilds the browser.autoninjais Chromium's build driver.-Csays which build directory to use, here~/chromium/src/out/asan-release. The nameasan-releasetells you this build is an ASAN build in release configuration.chromeis the target to build.
What is ASAN? AddressSanitizer is a tool built into the compiler that watches memory use while a program runs. It puts invisible fences around every allocation and, when memory is freed, marks it as poisoned. If the program reads poisoned memory, ASAN stops it and prints a detailed report. It is like a building inspector who marks every demolished house and raises an alarm if anyone walks in.
The proof of concept is a file named poc.html, launched under Xvfb with ASAN configured to ignore ODR violations:
ASAN_OPTIONS=detect_odr_violation=0 xvfb-run -a \
~/chromium/src/out/asan-release/chrome \
--user-data-dir=/tmp/poc-$(date +%s) \
issue_framesink_invalidation_uaf/poc.html
Line by line:
ASAN_OPTIONS=detect_odr_violation=0sets an environment variable that ASAN reads. It sets an ASAN option that disables the ODR violation check; the report does not explain why.xvfb-run -aruns the following command inside a virtual display. Xvfb is a fake screen that exists only in memory. It is used on machines with no real monitor, such as build servers.-atells it to pick a free display number automatically.~/chromium/src/out/asan-release/chromeis the browser binary that was just built.--user-data-dir=/tmp/poc-$(date +%s)gives the browser a fresh profile directory.$(date +%s)inserts the current time in seconds, so each run gets a unique folder. This avoids interference from a previous run's saved state.issue_framesink_invalidation_uaf/poc.htmlis the page to open. It is the proof of concept.
The report says the GPU/Viz process crashes with a heap-use-after-free within approximately one second, on the VizCompositorThread inside SurfaceManager::InvalidateFrameSinkId. The full ASAN log is said to be in asan.log; the report reproduces the key portion inline.
The attacker model is a compromised renderer. The report states that such a renderer can construct the necessary state entirely through the EmbeddedFrameSinkProvider and CompositorFrameSink Mojo interfaces, and trigger the invalidation by closing a connection. No user interaction beyond loading the page is described.
- An attacker model is a statement of what the attacker is assumed to control. Here, the attacker already controls the page's process. That is a strong starting point, but the sandbox is supposed to contain it.
EmbeddedFrameSinkProviderandCompositorFrameSinkare Mojo interfaces: named sets of messages that a renderer is allowed to send to Viz. They are the menu the renderer can order from.- Closing a connection means ending one of those Mojo channels. Closing the connection leads the browser to forward an InvalidateFrameSinkId call to Viz, which triggers the bug.
Finding it
The researcher identified a reentrancy problem in SurfaceManager::InvalidateFrameSinkId. The function iterates a vector of allocation group pointers with a range-for loop. Inside the loop body it calls WillNotRegisterNewSurfaces() on each group. That call is not a leaf: it synchronously resolves activation dependencies, which can activate a pending surface, which recomputes the active referenced surfaces, which can create new allocation groups and push_back them into the same vector. If the vector reallocates, the loop's captured iterators point into freed memory.
Let us slow that down.
- A range-for loop is C++ shorthand for "for each item in this container". Under the hood it grabs a cursor to the start and a cursor to the end, then walks from one to the other.
- A leaf function is one that does not call anything else.
WillNotRegisterNewSurfaces()is not a leaf: it calls other functions, which call others, and eventually one of them can add to the vector. - Synchronously means the call happens right now, before the caller continues. It is not queued for later. That is the crux: the vector is being changed while the loop is still using it.
- Activation dependencies are notes on a frame saying "do not show me until this other thing is ready". A pending frame waits for its dependencies to be resolved.
- Referenced surfaces are notes on a frame saying "I refer to these other surfaces". When a frame becomes active, Viz walks these notes and makes sure each referenced surface has an allocation group.
push_backis the vector operation that adds an item at the end.
The report frames this as a reentrant vector mutation during FrameSink invalidation. The key observation is that the callback chain from WillNotRegisterNewSurfaces back into GetOrCreateAllocationGroupForSurfaceId is synchronous and can target the same FrameSinkId that is currently being invalidated.
In everyday terms: the cleanup routine is walking a list of folders. For each folder it calls a helper. The helper, before returning, creates new folders and files them in the same cabinet. The cabinet runs out of space, so it moves everything to a bigger cabinet and throws the old one away. The cleanup routine is still holding a note that says "next folder is in the old cabinet, third shelf". That shelf no longer exists.
Exploitation
The report describes the construction at the level of Mojo interfaces and frame metadata rather than giving literal message bytes. The steps below follow the report's description exactly; where the report does not give a concrete payload, none is invented here.
A note on what is and is not in the report: the report does not include the raw bytes of any Mojo message, nor the contents of poc.html. It describes the sequence of API calls and the shape of the frame metadata. We stick to that.
Step 1: create the target frame sink and three attacker frame sinks
The compromised renderer creates a target FrameSink X and three attacker FrameSinks through blink.mojom.EmbeddedFrameSinkProvider.CreateSimpleCompositorFrameSink.
Why this step: the attacker needs one frame sink to be the victim (X) and several others to hold frames that depend on X. The three attacker sinks each contribute one allocation group to X's vector, giving it three elements.
blink.mojom.EmbeddedFrameSinkProvideris the Mojo interface that lets a renderer ask for frame sinks.CreateSimpleCompositorFrameSinkis the specific message that creates one.- X is just a name the report uses for the target frame sink.
Step 2: submit frames with activation dependencies on X
Each of the three attacker frame sinks submits a CompositorFrame carrying one activation_dependency that references X. The three use distinct embed tokens E1, E2 and E3. This creates three allocation groups in the vector for X.
Why this step: each dependency on X causes Viz to create an allocation group for X. Three dependencies, three groups. The vector for X now has three items. The distinct embed tokens (E1, E2, E3) make each dependency a separate entry rather than the same one repeated.
- An embed token is a value that identifies one embedding of a frame sink inside another. It keeps separate uses of the same frame sink apart.
Step 3: attach 200 referenced surfaces to the first attacker's frame
The first attacker's frame additionally carries 200 referenced_surfaces entries, each referencing X with a unique embed token. The report notes these entries are inert while the frame is pending.
Why this step: these 200 entries are the ammunition. While the frame is pending, they do nothing. The moment the frame is activated, Viz will walk all 200 and create an allocation group for each. That is what will overflow the three-item vector.
- Inert means doing nothing for now. The entries sit in the frame's metadata and wait.
Step 4: close the target's client connection to trigger invalidation
The renderer closes X's EmbeddedFrameSinkClient connection. The browser then forwards an InvalidateFrameSinkId(X) call to the Viz process.
Why this step: closing the connection is the trigger. The browser treats it as "this frame sink is going away" and tells Viz to invalidate it. Viz then runs the buggy loop.
EmbeddedFrameSinkClientis the other end of the connection: the client side that the renderer holds for a frame sink.InvalidateFrameSinkId(X)is the message that starts the cleanup for X.
Step 5: the loop re-enters and reallocates the vector
The loop processes E1's group first. Resolving the first attacker surface's sole dependency activates its pending frame, and RecomputeActiveReferencedSurfaces processes the 200 referenced_surfaces entries. Each entry calls GetOrCreateAllocationGroupForSurfaceId, which push_backs a new group into the vector for X. The vector grows from 3 elements to over 200 and reallocates its buffer. The next loop iteration dereferences the stale iterator into the freed 3-element buffer.
Why this matters: this is the whole bug in one paragraph. The loop is walking the vector. The first item's cleanup activates a frame. That activation creates 200 new items in the same vector. The vector moves to a bigger block and frees the old one. The loop's cursor still points at the old block. The next step of the loop reads freed memory.
- Dereferences means follows a pointer to read what it points at. Following a stale pointer is exactly the use-after-free.
Step 6: observe the ASAN crash
The report gives the following ASAN output, which shows the read in InvalidateFrameSinkId, the free in the vector growth path reached through RecomputeActiveReferencedSurfaces, and the earlier allocation through UpdateActivationDependencies:
==2458553==ERROR: AddressSanitizer: heap-use-after-free on address 0x7b2e9da4f4c8 at pc 0x7efea76d1825 bp 0x7afe82a9eb30 sp 0x7afe82a9eb28
READ of size 8 at 0x7b2e9da4f4c8 thread T15 (VizCompositorTh)
#0 0x7efea76d1824 in viz::SurfaceManager::InvalidateFrameSinkId(viz::FrameSinkId const&) base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h:1018:47
#1 0x7efea75774b5 in viz::FrameSinkManagerImpl::InvalidateFrameSinkId(viz::FrameSinkId const&, base::OnceCallback<void ()>) components/viz/service/frame_sinks/frame_sink_manager_impl.cc:223:20
#2 0x7efea77696ae in viz::mojom::FrameSinkManagerStubDispatch::AcceptWithResponder(viz::mojom::FrameSinkManager*, mojo::Message*, std::__Cr::unique_ptr<mojo::MessageReceiverWithStatus, std::__Cr::default_delete<mojo::MessageReceiverWithStatus>>) gen/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom.cc:3271:13
0x7b2e9da4f4c8 is located 8 bytes inside of 32-byte region [0x7b2e9da4f4c0,0x7b2e9da4f4e0)
freed by thread T15 (VizCompositorTh) here:
#0 0x5596ce120b02 in operator delete(void*, unsigned long)
#1 0x7efea76db70d in std::__Cr::vector<...>::__emplace_back_slow_path gen/third_party/libc++/src/include/__new/allocate.h:63:10
#2 0x7efea76cfed8 in viz::SurfaceManager::GetOrCreateAllocationGroupForSurfaceId(viz::SurfaceId const&) gen/third_party/libc++/src/include/__vector/vector.h:1148:21
#3 0x7efea76a888f in viz::Surface::RecomputeActiveReferencedSurfaces() components/viz/service/surfaces/surface.cc:634:27
#4 0x7efea76ad04e in viz::Surface::ActivateFrame(viz::Surface::FrameData) components/viz/service/surfaces/surface.cc:697:3
#5 0x7efea76a7df9 in viz::Surface::ActivatePendingFrame() components/viz/service/surfaces/surface.cc:520:3
#6 0x7efea76af659 in viz::Surface::OnActivationDependencyResolved(viz::SurfaceId const&, viz::SurfaceAllocationGroup*) components/viz/service/surfaces/surface.cc:459:3
#7 0x7efea76cb544 in viz::SurfaceAllocationGroup::WillNotRegisterNewSurfaces() components/viz/service/surfaces/surface_allocation_group.cc:180:18
#8 0x7efea76d1781 in viz::SurfaceManager::InvalidateFrameSinkId(viz::FrameSinkId const&) components/viz/service/surfaces/surface_manager.cc:170:14
previously allocated by thread T15 (VizCompositorTh) here:
#0 0x5596ce11fefd in operator new(unsigned long)
#1 0x7efea76db5e4 in std::__Cr::vector<...>::__emplace_back_slow_path gen/third_party/libc++/src/include/__new/allocate.h:43:28
#2 0x7efea76cfed8 in viz::SurfaceManager::GetOrCreateAllocationGroupForSurfaceId(viz::SurfaceId const&) gen/third_party/libc++/src/include/__vector/vector.h:1148:21
#3 0x7efea76ac1d6 in viz::Surface::UpdateActivationDependencies(viz::CompositorFrame const&) components/viz/service/surfaces/surface.cc:802:27
#4 0x7efea76aab53 in viz::Surface::CommitFrame(viz::Surface::FrameData) components/viz/service/surfaces/surface.cc:343:3
#5 0x7efea76a9e4a in viz::Surface::QueueFrame(viz::CompositorFrame, unsigned int, base::ScopedClosureRunner) components/viz/service/surfaces/surface.cc:270:14
#6 0x7efea7541176 in viz::CompositorFrameSinkSupport::MaybeSubmitCompositorFrame components/viz/service/frame_sinks/compositor_frame_sink_support.cc:1014:55
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.
How to read this log. ASAN reports three things about the same address: what happened now, who freed it, and who allocated it originally.
- The first line says ASAN caught a heap-use-after-free at address
0x7b2e9da4f4c8. Thepc,bpandspvalues are the program counter, base pointer and stack pointer at the moment of the fault. They are machine-level bookkeeping. READ of size 8means the program tried to read 8 bytes. On a 64-bit machine, a pointer is 8 bytes, so this is consistent with reading a pointer from the vector.thread T15 (VizCompositorTh)says this happened on the Viz compositor thread.- The first stack (frames
#0to#2) is the read stack: where the bad read happened.#0is insideInvalidateFrameSinkId, reached fromFrameSinkManagerImpl::InvalidateFrameSinkId, reached from the Mojo dispatcher. That is the loop reading its stale cursor. 0x7b2e9da4f4c8 is located 8 bytes inside of 32-byte regiontells us the freed block was 32 bytes and the read landed 8 bytes into it. The freed block was 32 bytes and the read landed 8 bytes into it.- The second stack is the free stack: who freed the memory.
operator deleteis the C++ memory release. It was called from the vector's growth path (__emplace_back_slow_path), reached fromGetOrCreateAllocationGroupForSurfaceId, reached fromRecomputeActiveReferencedSurfaces, reached fromActivateFrame, reached fromActivatePendingFrame, reached fromOnActivationDependencyResolved, reached fromWillNotRegisterNewSurfaces, reached fromInvalidateFrameSinkId. That is exactly the reentrant chain described above. - The third stack is the allocation stack: who first allocated the block. It was allocated by the vector growth path reached from
GetOrCreateAllocationGroupForSurfaceId, reached fromUpdateActivationDependencies, reached fromCommitFrame, reached fromQueueFrame, reached fromMaybeSubmitCompositorFrame. That is the moment the three attacker frames were submitted and the three-item vector was created. MiraclePtr Status: NOT PROTECTEDandThis crash is still exploitable with MiraclePtrsay that Chromium's general mitigation for use-after-free does not cover this access. **MiraclePtr is a Chromium mitigation that delays reuse of freed memory so a stale pointer read is less likely to hit reused memory. It protects the objects a pointer points at, not the internal buffer of a container. Here the freed thing is the vector's buffer, so MiraclePtr does not help.
The report notes that the read is of size 8, that the freed region is 32 bytes, and that the read lands 8 bytes inside it. The report also notes that the crash is still exploitable with MiraclePtr.
Root cause
The report gives the relevant code. SurfaceManager::InvalidateFrameSinkId looks up the allocation groups for a FrameSinkId and iterates them:
// components/viz/service/surfaces/surface_manager.cc:166-174
void SurfaceManager::InvalidateFrameSinkId(const FrameSinkId& frame_sink_id) {
auto it = frame_sink_id_to_allocation_groups_.find(frame_sink_id);
if (it != frame_sink_id_to_allocation_groups_.end()) {
for (SurfaceAllocationGroup* group : it->second) {
group->WillNotRegisterNewSurfaces();
}
}
GarbageCollectSurfaces();
}
Line by line:
void SurfaceManager::InvalidateFrameSinkId(const FrameSinkId& frame_sink_id) {declares the function. It takes a frame sink ID by reference and returns nothing.auto it = frame_sink_id_to_allocation_groups_.find(frame_sink_id);looks up the frame sink ID in a map (a dictionary from ID to vector of groups).itis the result of the lookup.if (it != frame_sink_id_to_allocation_groups_.end()) {checks that the lookup found something.end()means "not found".for (SurfaceAllocationGroup* group : it->second) {is the range-for loop.it->secondis the vector stored for this frame sink. The loop grabs a start and end cursor into that vector's buffer.group->WillNotRegisterNewSurfaces();calls the helper on each group. This is the call that can re-enter and grow the vector.}closes the loop.}closes the if.GarbageCollectSurfaces();runs cleanup afterwards. By this point the damage is done.
The range-for loop captures begin() and end() iterators of it->second, a std::vector<raw_ptr<SurfaceAllocationGroup, VectorExperimental>>. Those iterators point into the vector's internal heap buffer.
raw_ptr<...>is a Chromium wrapper around a raw pointer. It adds checks and, with MiraclePtr, keeps the pointed-to object alive longer.VectorExperimentalis a configuration tag for how the wrapper behaves inside vectors. The important point: the wrapper protects the objects the pointers point at, not the vector's own buffer.
WillNotRegisterNewSurfaces moves out the blocked embedders and synchronously resolves their activation dependencies:
// components/viz/service/surfaces/surface_allocation_group.cc:176-182
void SurfaceAllocationGroup::WillNotRegisterNewSurfaces() {
base::flat_map<Surface*, SurfaceId> embedders = std::move(blocked_embedders_);
blocked_embedders_.clear();
for (const auto& entry : embedders) {
entry.first->OnActivationDependencyResolved(entry.second, this);
}
}
Line by line:
void SurfaceAllocationGroup::WillNotRegisterNewSurfaces() {declares the helper.base::flat_map<Surface*, SurfaceId> embedders = std::move(blocked_embedders_);takes the group's map of blocked embedders and moves it into a local variable.std::movetransfers ownership without copying.base::flat_mapis Chromium's sorted map type.blocked_embedders_.clear();empties the member, which is now redundant after the move but harmless.for (const auto& entry : embedders) {walks the local map.entry.first->OnActivationDependencyResolved(entry.second, this);tells each blocked surface that its dependency on this group is resolved. This is the synchronous call that can cascade into activation.}closes the loop.}closes the function.
If the resolved dependency was the last outstanding one for a surface, OnActivationDependencyResolved calls ActivatePendingFrame, which calls ActivateFrame, which calls RecomputeActiveReferencedSurfaces. That function iterates the activated frame's referenced_surfaces metadata and calls GetOrCreateAllocationGroupForSurfaceId for each entry:
// components/viz/service/surfaces/surface_manager.cc:656-661
if (!allocation_group) {
allocation_group = std::make_unique<SurfaceAllocationGroup>(
this, surface_id.frame_sink_id(),
surface_id.local_surface_id().embed_token());
frame_sink_id_to_allocation_groups_[surface_id.frame_sink_id()].push_back(
allocation_group.get());
}
Line by line:
if (!allocation_group) {checks whether an allocation group already exists for this surface ID.allocation_group = std::make_unique<SurfaceAllocationGroup>(creates a new one.std::make_uniqueallocates an object and hands back a smart pointer that owns it.this, surface_id.frame_sink_id(),passes the manager and the frame sink ID.surface_id.local_surface_id().embed_token());passes the embed token.frame_sink_id_to_allocation_groups_[surface_id.frame_sink_id()].push_back(looks up the vector for this frame sink ID and appends to it. If this is the same frame sink currently being invalidated, this is the same vector the loop is walking.allocation_group.get());passes the raw pointer to store in the vector.}closes the if.
When surface_id.frame_sink_id() matches the FrameSinkId being invalidated, push_back appends to the same vector that InvalidateFrameSinkId is iterating. If capacity is exceeded, the buffer is reallocated and the old one freed. The range-for loop then advances its stale iterator into the freed buffer and reads a dangling SurfaceAllocationGroup*.
The report lists the defences that do not stop this path. There are no CHECK guards on the iteration, no reentrancy protection, and no copy of the vector before iteration. The raw_ptr<VectorExperimental> wrapper on the elements protects the pointed-to SurfaceAllocationGroup objects but not the vector's own internal buffer from iterator invalidation. The mojom deserialisation in compositor_frame_metadata_mojom_traits.cc imposes no restrictions on the number or content of referenced_surfaces or activation_dependencies. ASAN reports MiraclePtr Status: NOT PROTECTED for the access.
- A
CHECKis an assertion: a line that crashes the program if a condition is false. The report notes there are no CHECK guards on the iteration. - Reentrancy protection is a guard that stops a function from being re-entered while it is running, for example a flag that says "already busy".
- Copying the vector before iteration would mean walking a private snapshot, so changes to the real vector would not affect the walk. That is a common fix pattern.
- Deserialisation is turning bytes from a message back into objects. The traits file is where that happens for frame metadata. The report says the deserialisation imposes no restrictions on the number or content of these fields.
Impact
The report describes a heap use-after-free in the Viz process, reachable by a compromised renderer through normal Mojo interfaces. The crash occurs on the VizCompositorThread, which the report notes runs outside the renderer sandbox. It states that the crash is still exploitable with MiraclePtr, which is relevant because MiraclePtr is a mitigation against use-after-free in Chromium. The severity recorded by the platform is high, with a bounty of 16,000 USD.
- Code execution means making the computer run the attacker's instructions. The report does not claim this.
- Control over the freed memory means being able to decide what is placed in the freed block before the stale read happens. That is what turns a crash into a reliable exploit. The report does not demonstrate it.
- Exploitable here means the crash is not neutralised by MiraclePtr, so the underlying memory-safety problem is still present.
The conditions are that the attacker controls a renderer and can create frame sinks and submit compositor frames through the described interfaces, and that the target frame sink's invalidation is triggered by closing the client connection.
Fix
It identifies the introducing commit and the reproduction revision, and it describes the missing protections (no CHECK guards, no reentrancy protection, no copy of the vector before iteration). A fix would need to prevent the vector from being mutated during iteration, for example by copying the vector before iterating or by deferring the creation of new allocation groups until after the loop.
In plain terms: the report tells you what is wrong and how to make it happen. It does not tell you what the maintainers did about it. Any statement about the actual fix would be speculation, so we leave it out.
Variants to test
The report's mechanism suggests several concrete things to try on other targets. Each is stated with what a positive result would look like.
- Other range-for loops over containers that are mutated by synchronous callbacks. Look for loops in compositor, IPC and service code where the loop body calls into code that can
push_backinto the same container. A positive result is an ASAN heap-use-after-free report whose free stack shows the container growth path and whose read stack shows the loop. - Other invalidation paths that resolve pending state synchronously. Look for functions named like
Invalidate*,WillNot*,On*Resolvedthat call into activation or dependency resolution. A positive result is a reentrant call that reaches the same container being iterated. - Metadata fields with no deserialisation limits. The report notes that
compositor_frame_metadata_mojom_traits.ccimposes no restrictions on the number or content ofreferenced_surfacesoractivation_dependencies. Try large counts of these fields on other frame metadata paths. A positive result is a crash or a measurable resource effect that the receiver does not bound. raw_ptrwrappers on container elements. The report shows that protecting the pointed-to objects does not protect the container's buffer. Look for otherstd::vector<raw_ptr<...>>members that are iterated while callbacks run. A positive result is an ASAN report withMiraclePtr Status: NOT PROTECTEDon the container buffer.- Connection close as a trigger. The report triggers invalidation by closing an
EmbeddedFrameSinkClientconnection. Try closing other client connections that lead to synchronous teardown of shared state. A positive result is a crash on the service thread outside the renderer sandbox.
Why these are worth trying: the same shape of mistake (a loop over a container that a callback can grow) is common in large codebases. The report gives a recipe for recognising it. The 200-entry metadata point is also a reminder that message receivers should bound what they accept.
Glossary
- API: a defined way for one program to ask another to do something, like a menu of allowed requests.
- ASAN (AddressSanitizer): a compiler tool that watches memory use and reports reads or writes to freed or out-of-bounds memory.
- Allocation group: Viz's bookkeeping record grouping related surfaces for a frame sink.
- Attacker model: a statement of what an attacker is assumed to control.
- Bisect: searching code history to find the change that introduced a bug.
- Bounty: money paid for a responsibly reported vulnerability.
- CHECK: an assertion in code that crashes the program if a condition is false.
- Code execution: making a computer run the attacker's instructions.
- Commit: a saved change to a codebase with an identifier, date and author.
- Compositing: combining layers into the final picture shown on screen.
- CompositorFrame: one picture plus metadata such as dependencies and references.
- Compromised renderer: a page process already under attacker control.
- CVE: a public identifier for a known vulnerability.
- Dangling: pointing at something that no longer exists.
- Dereference: follow a pointer to read what it points at.
- Deserialisation: turning bytes from a message back into objects.
- Embed token: a value identifying one embedding of a frame sink inside another.
- Exploitable: still usable by an attacker despite mitigations.
- Frame sink: Viz's named destination for submitted frames.
- FrameSinkId: the unique name of a frame sink.
- Heap: the general-purpose memory pool a program uses for objects created at runtime.
- Inert: doing nothing for now.
- Iterator: a cursor that walks through a container; in a vector, effectively a pointer into its buffer.
- Leaf function: a function that calls nothing else.
- Memory: the computer's working memory (RAM).
- MiraclePtr: a Chromium mitigation that keeps freed objects alive longer and quarantines them, reducing the impact of stale pointer reads.
- Mojo: Chromium's internal API system for typed messages between processes.
- ODR violation: a C++ rule about definitions appearing only once; ASAN can check for it.
- Pointer: a number saying where in memory something lives.
- Process: a running program with its own private memory.
- push_back: the vector operation that adds an item at the end.
- Range-for loop: C++ shorthand for iterating every item in a container.
- raw_ptr: a Chromium wrapper around a raw pointer that adds checks and mitigation support.
- Reallocation: when a vector outgrows its block, it moves to a bigger block and frees the old one.
- Reentrancy: a function being called again while it is still running, indirectly.
- Renderer: the process that runs a web page's code.
- Revision: a specific snapshot of a codebase.
- Sandbox: restrictions around a process that limit what it can do if compromised.
- Severity: a rating of how serious a vulnerability is.
- Synchronously: happening right now, before the caller continues.
- Thread: a stream of execution inside a process.
- Use-after-free: reading or writing memory that has already been freed.
- Vector: a growable list stored in one contiguous block of memory.
- Viz: Chromium's compositor service process.
- VizCompositorThread: the thread inside Viz that does compositing work.
- Xvfb: a virtual display that exists only in memory, used on machines without a real monitor.