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

Use after free in Scroll (CVE-2026-113337)

A detached scroll animator can resolve a promise during garbage collection, allowing synchronous JavaScript execution via a malicious then getter while the heap is being swept. This creates a potential use-after-free primitive.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 6 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.

Overview: When the experimental ProgrammaticScrollPromise feature is enabled, a detached ProgrammaticScrollAnimator can resolve a promise during an Oilpan GC sweep. This allows an attacker to synchronously execute JavaScript via an Object.prototype.then getter while the heap is in an inconsistent state. Running script during GC finalization creates a potential Use-After-Free (UAF) primitive.

Affected files:

  • third_party/blink/renderer/core/scroll/programmatic_scroll_animator.cc
  • third_party/blink/renderer/core/scroll/scroll_promise_resolver.h
  • third_party/blink/renderer/core/scroll/scrollable_area.cc
  • third_party/blink/renderer/bindings/core/v8/script_promise_resolver.cc

Estimated timestamp from git blame: 2024-02-27

Summary

A potential security vulnerability exists in the interaction between ProgrammaticScrollAnimator, ScrollPromiseResolver, and the Oilpan (cppgc) garbage collection mechanism. When the experimental ProgrammaticScrollPromise feature is enabled, it is possible to trigger synchronous JavaScript execution during the Oilpan incremental sweep phase. This violates Blink's core invariant that destructors and GC sweeping must not run script, creating a potential Use-After-Free (UAF) vulnerability. MiraclePtr (BackupRefPtr) does not mitigate this, as the affected objects are managed by Oilpan's Member<> pointers.

Technical Details

The issue originates in how ScrollableArea manages the ProgrammaticScrollAnimator. When an animation is initiated via ScrollableArea::InitiateScrollAnimation, a ScrollCallback is created that takes ownership of a std::unique_ptr<ScrollPromiseResolver::ActiveScrollTracker>. This callback is stored in ProgrammaticScrollAnimator::on_finish_.

If the ScrollableArea is disposed (e.g., via PaintLayerScrollableArea::DisposeImpl), ScrollableArea::ClearScrollableArea is called. This method detaches the ProgrammaticScrollAnimator and clears the Member<> reference to it, but crucially, it does not call CancelAnimation() or otherwise clear the on_finish_ callback.

When the unreferenced ProgrammaticScrollAnimator is later garbage-collected during an IncrementalSweepTask, its destructor executes the on_finish_ callback. The destruction of the callback destroys the ActiveScrollTracker, which tells the ScrollPromiseResolver to resolve the promise with a ScrollResult dictionary.

Because IncrementalSweepTask runs on a normal foreground task runner without entering a ScriptForbiddenScope, ScriptPromiseResolverBase::NotifyResolveOrReject believes it is safe to resolve the promise immediately. During V8's internal promise resolution of the ScrollResult dictionary, the engine synchronously accesses the then property to check if the object is a "thenable". An attacker can define a malicious getter on Object.prototype.then to gain synchronous JavaScript execution while Oilpan is actively sweeping the heap, allowing them to interact with partially destroyed objects.

Potential Steps to Reproduce

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

  1. Run Chrome with the experimental ProgrammaticScrollPromise feature enabled (e.g., via --enable-experimental-web-platform-features).
  2. In JavaScript, define a malicious getter: Object.defineProperty(Object.prototype, 'then', { get: function() { /* interact with heap */ } });
  3. Create a scrollable element and initiate a smooth scroll: element.scrollTo({top: 100, behavior: 'smooth'}). This populates ProgrammaticScrollAnimator::on_finish_ with the tracker-owning callback.
  4. Interrupt the scrollable area synchronously (e.g., by changing overflow: visible and forcing a layout update). This destroys the PaintLayerScrollableArea and drops the reference to the animator without cancelling the animation.
  5. Trigger garbage collection. When the IncrementalSweepTask sweeps the animator, the destructor will run the callback, resolve the promise, and synchronously trigger the then getter.

Suggested Fix

Ensure that the animation is properly cancelled when the ProgrammaticScrollAnimator is detached.

In third_party/blink/renderer/core/scroll/scrollable_area.cc, update ClearScrollableArea():

C++
void ScrollableArea::ClearScrollableArea() {
  // ...
  if (programmatic_scroll_animator_) {
    programmatic_scroll_animator_->CancelAnimation(); // ADD THIS
    programmatic_scroll_animator_->DetachElement();
    programmatic_scroll_animator_.Clear();
  }
  // ...
}

Additionally, it may be worth reviewing if IncrementalSweepTask should execute within a ScriptForbiddenScope or if ProgrammaticScrollAnimator::~ProgrammaticScrollAnimator should avoid executing complex callbacks that might re-enter V8 during destruction.

Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b


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 ScrollableArea::ClearScrollableArea method detaches the ProgrammaticScrollAnimator without cancelling its on_finish_ callback, so the callback runs during garbage collection and resolves a promise, executing script in a forbidden scope.

Impact

An attacker could potentially execute JavaScript during garbage collection, leading to a use-after-free that may allow memory corruption or code execution.

What the attacker needed

Experimental feature enabled; attacker controls JavaScript

The fix

The animation should be cancelled when the ProgrammaticScrollAnimator is detached, and the sweep task should run within a ScriptForbiddenScope.

How it was found

  1. Run Chrome with the experimental ProgrammaticScrollPromise feature enabled.
  2. Define a malicious getter on Object.prototype.then.
  3. Create a scrollable element and initiate a smooth scroll.
  4. Interrupt the scrollable area synchronously to destroy it without cancelling the animation.
  5. Trigger garbage collection to sweep the animator and resolve the promise.

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 web page scrolls smoothly, the browser may create a promise that resolves when the scroll finishes. If the scrollable area is removed, the animator that holds the promise is not properly cancelled. Later, during garbage collection, the promise resolves and runs attacker-controlled JavaScript at a time when the browser's memory is in an inconsistent state, which could lead to memory corruption.

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.