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

Use after free in Viz (CVE-2026-10918)

A use-after-free in the GPU process occurs when property trees are resized and RenderSurfaceImpl objects are freed, but an early validation failure leaves dangling pointers in LayerTreeImpl's render surface list. An attacker with a compromised renderer could trigger a draw that dereferences these pointers, potentially leading to remote code execution in the GPU 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.

Overview: A Use-After-Free (UAF) vulnerability exists in the GPU process when kTreesInViz is enabled. LayerContextImpl resizes property trees, freeing RenderSurfaceImpl objects, but can abort early on validation errors without updating needs_update_draw_properties_, leaving dangling pointers in LayerTreeImpl's render surface list.

Affected files:

  • components/viz/service/layers/layer_context_impl.cc
  • cc/trees/damage_tracker.cc
  • cc/trees/layer_tree_impl.cc
  • cc/trees/property_tree.cc

Estimated timestamp from git blame: 2025-06-04

Summary

A potential Use-After-Free (UAF) vulnerability has been identified in the GPU process within the LayerContextImpl component, affecting the kTreesInViz code path. The root cause is that DoUpdateDisplayTree performs irreversible state mutations—specifically shrinking property trees and freeing RenderSurfaceImpl objects—before completing the validation of the display tree update.

If validation fails subsequently (e.g., due to an invalid page_scale_factor), the update is aborted early. This early return bypasses the logic that sets needs_update_draw_properties_ = true. Consequently, LayerTreeImpl is left in a "torn" state where its render_surface_list_ (which uses RAW_PTR_EXCLUSION) contains raw pointers to the now-freed RenderSurfaceImpl heap allocations. A subsequent draw operation will dereference these dangling pointers.

Potential Exploitation Steps

Note: These are suggested steps based on static analysis. Our tooling agent does not yet have the ability to run code to provide a working proof of concept.

  1. Initial Setup: A compromised Renderer process establishes a valid mojom::LayerContext connection to the GPU process.
  2. Clear Draw Flag: The Renderer sends a valid mojom::LayerTreeUpdate with frame_has_damage = true. This forces a successful draw cycle, which sets LayerTreeImpl::needs_update_draw_properties_ to false and populates render_surface_list_ with valid pointers.
  3. Trigger the Free: The Renderer crafts a malicious LayerTreeUpdate where update->num_effect_nodes is smaller than the current size. DoUpdateDisplayTree calls ResizePropertyTree, which physically removes effect nodes and frees their associated RenderSurfaceImpl objects.
  4. Heap Grooming: The attacker includes a large array in update->surface_ranges. The allocation of the base::flat_set backing vector for these ranges lands in the recently freed RenderSurfaceImpl heap slots. The attacker fills this array with crafted bytes representing a fake RenderSurfaceImpl object (including a forged damage_tracker_ pointer).
  5. Trigger the Abort: The attacker sets update->page_scale_factor to NaN. Validation fails at layer_context_impl.cc:1976, causing an early return. needs_update_draw_properties_ remains false.
  6. Trigger the Draw: The early return calls ReportBadMessage, which queues an asynchronous Mojo teardown task. Before it runs, the attacker sends SetNeedsBeginFrame(true) via the CompositorFrameSink interface on the same pipe. This schedules a local BeginFrame task on the Viz thread.
  7. The UAF: The BeginFrame task executes first, calling LayerTreeHostImpl::PrepareToDraw. Because needs_update_draw_properties_ is false, it skips recalculating the draw properties and keeps the stale render_surface_list_.
  8. RCE Primitives: PrepareToDraw calls DamageTracker::UpdateDamageTracking, which iterates the stale list and executes render_surface->damage_tracker()->PrepareForUpdate(). Using the attacker's forged damage_tracker_ pointer, PrepareForUpdate() executes with a controlled this context. This provides the attacker with an arbitrary 32-bit increment primitive (mailbox_id_++) and an arbitrary vector clear primitive (contributing_surfaces_.clear()), which can be chained to achieve Remote Code Execution (RCE) in the GPU process.

Suggested Fix

Ensure that the needs_update_draw_properties_ flag is set to true (or the render_surface_list_ is explicitly cleared) whenever property trees are physically mutated, regardless of whether the overall DoUpdateDisplayTree function succeeds or fails.

For example, ResizePropertyTree could accept the LayerTreeImpl reference and call set_needs_update_draw_properties() internally if it returns true. Alternatively, DoUpdateDisplayTree could use a base::ScopedClosureRunner to ensure state cleanup on early returns.

Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33


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

DoUpdateDisplayTree mutates property trees and frees RenderSurfaceImpl objects before validation completes, and an early return on validation failure skips setting needs_update_draw_properties_, leaving stale raw pointers in render_surface_list_.

Impact

An attacker with a compromised renderer could achieve remote code execution in the GPU process via arbitrary increment and vector clear primitives, though the report notes these are suggested steps from static analysis without a working proof of concept.

What the attacker needed

Compromised renderer process; kTreesInViz enabled

The fix

The fix should ensure that needs_update_draw_properties_ is set to true (or the render surface list is cleared) whenever property trees are mutated, regardless of whether DoUpdateDisplayTree succeeds or fails.

How it was found

  1. A compromised renderer establishes a valid LayerContext connection to the GPU process.
  2. The renderer sends a valid LayerTreeUpdate with frame_has_damage set, forcing a successful draw that clears the update flag and populates the render surface list.
  3. The renderer sends a LayerTreeUpdate with fewer effect nodes, causing ResizePropertyTree to free RenderSurfaceImpl objects.
  4. The renderer includes a large surface_ranges array to heap-groom the freed slots with a fake RenderSurfaceImpl.
  5. The renderer sets page_scale_factor to NaN, so validation fails and the function returns early without setting the update flag.
  6. Before the asynchronous Mojo teardown runs, the renderer requests a BeginFrame, which triggers a draw that dereferences the stale pointers.

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 some memory but keeps a pointer to it, then later uses that pointer as if the memory still belonged to it. Here, the GPU process frees some objects but forgets to mark that its list of surfaces is out of date, so a later draw reads the freed memory. An attacker who already controls the renderer process could shape that freed memory and potentially run code in the more privileged GPU 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.