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

Use after free in Views (CVE-2026-17670)

A use-after-free was identified in View::OrphanLayers, which keeps a raw pointer to a parent layer while a loop removes child layers. Removing a layer can synchronously abort an animation, and an observer callback could destroy the parent layer, leaving the pointer dangling for later iterations.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 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 Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A potential Use-After-Free (UAF) vulnerability exists in View::OrphanLayers because it maintains a raw pointer to a parent layer across a loop that can trigger synchronous destruction of that parent via animation observers.

Affected files:

  • ui/views/view.cc
  • ui/compositor/layer.cc

Estimated timestamp from git blame: Unknown (Google3 checkout)

Summary

A potential Use-After-Free (UAF) vulnerability has been identified in View::OrphanLayers within ui/views/view.cc. The function iterates through the layers associated with a View and removes them from their parent ui::Layer. However, the removal process can trigger synchronous callbacks that destroy the parent layer, causing the raw parent pointer to dangle during subsequent iterations of the loop.

Technical Analysis

In ui/views/view.cc, View::OrphanLayers captures the parent layer as a raw pointer and iterates over child layers:

C++
// ui/views/view.cc:3763
if (ui::Layer* parent = layer()->parent()) {
  for (ui::Layer* layer : GetLayersInOrder()) {
    // ... crash key instrumentation accesses parent->name() ...
    parent->Remove(layer);
  }
}

When parent->Remove(layer) is called (located in ui/compositor/layer.cc), it attempts to stop any ongoing animations on the child layer to ensure consistent state:

C++
// ui/compositor/layer.cc:432
child_animator->StopAnimatingProperty(LayerAnimationElement::BOUNDS);

Stopping an animation synchronously triggers LayerAnimationObserver callbacks, such as OnLayerAnimationAborted. An observer can execute arbitrary logic, including destroying the Widget or View that owns the parent layer. If the parent layer is destroyed during the first iteration of the loop, the parent pointer in View::OrphanLayers becomes dangling.

Subsequent iterations will attempt to access this freed memory, first during crash key instrumentation (e.g., calling parent->name()) and then in the next parent->Remove(layer) call.

This re-entrancy risk is a known pattern; a similar issue was addressed within Layer::Remove itself (see crbug.com/1088432) by adding a base::WeakPtr guard. However, the outer loop in View::OrphanLayers lacks such protection. Production crash data (tracked in b/319941708) and the presence of investigative crash keys in the current source code confirm that this re-entrant state is being reached in the field.

While the ui::Layer class is protected by ADVANCED_MEMORY_SAFETY_CHECKS(), which can enable Scheduler-Loop Quarantine to prevent immediate memory reuse, the vulnerability still allows for a Use-After-Free dereference in the unsandboxed browser process.

Potential Attack Steps

An attacker might attempt to trigger this vulnerability through the following suggested steps:

  1. Identify a View that manages multiple layers (e.g., a View using AddLayerToRegion for shadows or background effects).
  2. Initiate a bounds animation on one of the auxiliary layers.
  3. Attach a malicious animation observer that destroys the parent View or its Widget when the animation is aborted.
  4. Trigger a UI action from a compromised renderer that causes the child View to be removed from its parent (e.g., closing a tab or a specific UI component).
  5. During OrphanLayers, the first layer removal aborts the animation, the observer destroys the parent layer, and the subsequent iteration dereferences the dangling parent pointer.

Suggested Fix

The loop in View::OrphanLayers should be made re-entrancy safe. This can be achieved by using a base::WeakPtr<ui::Layer> to track the parent layer's lifetime:

C++
base::WeakPtr<ui::Layer> weak_parent = layer()->parent()->AsWeakPtr();
for (ui::Layer* layer : GetLayersInOrder()) {
  if (!weak_parent) break;
  weak_parent->Remove(layer);
}

Alternatively, since OrphanLayers is typically called during View destruction or removal, checking the View's own validity or the parent layer's existence between iterations would mitigate the risk.

Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e


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 loop holds a raw parent pointer across a call that can synchronously run observer callbacks which destroy the parent layer, with no weak-pointer guard.

Impact

The report claims a use-after-free dereference in the unsandboxed browser process, though memory safety checks may delay reuse of the freed memory; no working exploit is shown.

What the attacker needed

Compromised renderer; a View with multiple layers; an animation observer that destroys the parent

The fix

The loop should be made re-entrancy safe, for example by tracking the parent layer with a weak pointer and stopping when it is gone.

How it was found

  1. Find a View that manages several layers, such as one using AddLayerToRegion.
  2. Start a bounds animation on one of the auxiliary layers.
  3. Attach an animation observer that destroys the parent View or Widget when the animation is aborted.
  4. Trigger a UI action from a compromised renderer that removes the child View from its parent.
  5. During OrphanLayers the first removal aborts the animation, the observer destroys the parent layer, and the next iteration dereferences the dangling pointer.

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.

When a program frees a piece of memory but keeps using it, that is a use-after-free. Here a function remembers where a parent layer lives, then calls code that can delete that layer, and afterwards still tries to use the remembered location. The report is a code review finding, not a demonstrated attack.

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.