Use after free in SurfaceCapture (CVE-2026-10967)
A use-after-free vulnerability exists in the Android implementation of MouseCursorOverlayController during tab capture, where a dangling pointer to a freed ui::ViewAndroid object can be accessed after a renderer crash. An attacker could potentially exploit this to achieve arbitrary code execution in the browser process by grooming the heap and triggering mouse events.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 24 days
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 Use-After-Free (UAF) vulnerability exists in the browser process on Android when a renderer crashes during a tab capture session. MouseCursorOverlayController::Observer retains a dangling raw pointer to a freed ui::ViewAndroid due to an edge case in process death notification ordering, which can be exploited via subsequent mouse events.
Affected files:
content/browser/media/capture/web_contents_frame_tracker.cccontent/browser/media/capture/mouse_cursor_overlay_controller_android.cccontent/browser/media/capture/web_contents_frame_tracker.h
Estimated timestamp from git blame: 2026-03-30
Summary
A Use-After-Free (UAF) vulnerability exists in the Android implementation of the MouseCursorOverlayController, used to render mouse cursors during media capture (e.g., tab sharing). The issue occurs because WebContentsFrameTracker fails to clear its associated MouseCursorOverlayController when a renderer process crashes. This failure is rooted in the specific ordering of RenderProcessHost observer notifications. As a result, the controller's observer maintains a dangling raw pointer to a ui::ViewAndroid object, leading to a UAF and potential arbitrary code execution in the browser process (Sandbox Escape) when subsequent mouse events occur.
Vulnerability Details
During a tab capture session, WebContentsFrameTracker instantiates a MouseCursorOverlayController. On Android, this controller creates an Observer that stores a gfx::NativeView (a raw ui::ViewAndroid*) to track mouse movements. Because it is an alias, this pointer is not protected by MiraclePtr (base::raw_ptr).
When a renderer crashes, RenderProcessHostImpl::ProcessDied iterates over its observers. SiteInstanceGroup is always registered as an observer before RenderViewHostImpl.
- Frame Deletion:
SiteInstanceGroup::RenderProcessExitedfires first, cascading toRenderFrameHostImpl::RenderProcessGoneand triggering aRenderFrameDeletednotification. - Early Return Bypass:
WebContentsFrameTracker::RenderFrameDeletedcatches this notification and callsOnPossibleTargetChange(), which evaluatesGetCaptureTarget(). BecauseRenderViewHostImplhas not yet received the crash notification,RenderWidgetHostViewAndroid(and itsui::ViewAndroid) is still alive.SetTargetViewis called, but because theui::ViewAndroidpointer matches the existingtarget_native_view_, it returns early, bypassing the logic that would normally reset theMouseCursorOverlayController. - View Destruction: The observer loop continues, notifying
RenderViewHostImpl::RenderProcessExited, which destroys theRenderWidgetHostViewAndroidanddeletes theui::ViewAndroid. TheMouseCursorOverlayController::Observernow holds a dangling pointer. - UAF Trigger: If the user moves a physical mouse (or the attacker simulates mouse events), the surviving parent
EventForwardertriggersObserver::OnMouseEvent. This callscontroller_->OnMouseMoved, leading toUpdateOverlay.UpdateOverlayinvokesGetCurrentCursorOrDefault()andComputeRelativeBoundsForOverlay(), both of which execute the virtual methodobserver_->view()->GetDipScale()on the freed object.
If an attacker can successfully groom the browser process heap, this virtual method call provides a direct path to hijack the vtable and achieve arbitrary code execution.
Potential Reproduction Steps
Note: These steps are theoretical as our tooling does not execute code.
- An attacker tricks a user into visiting a malicious site on an Android device (e.g., a Chromebook running Android apps) and granting tab capture permissions (
getDisplayMedia). - The attacker's JavaScript initiates the capture, causing the browser to set up the
MouseCursorOverlayController. - The attacker intentionally triggers a renderer process crash (e.g., by exhausting memory).
- The attacker simultaneously simulates or induces mouse movement over the captured area.
- The browser process reads the dangling
ui::ViewAndroidpointer, resulting in a UAF whenGetDipScale()is called.
Suggested Fix
There are two primary ways to fix this:
- Adopt MiraclePtr: Change the
gfx::NativeView view_member inMouseCursorOverlayController::Observertoraw_ptr<ui::ViewAndroid>. This mirrors the Aura implementation (raw_ptr<aura::Window> window_) and would turn this exploitable UAF into a safe, non-exploitable crash. - Explicit Cleanup: Ensure
WebContentsFrameTrackerorMouseCursorOverlayControlleractively listens for view destruction (e.g., by implementingui::ViewAndroidObserver) so it can reset its internal pointers immediately upon view deletion, rather than relying onWebContentsObserversignals which are subject to subtle ordering bugs.
Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955
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.
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 observer notification order during renderer process death causes WebContentsFrameTracker to skip resetting the MouseCursorOverlayController, leaving a dangling raw pointer to a destroyed ui::ViewAndroid.
Impact
If an attacker can groom the browser process heap, the virtual method call on the freed object could lead to vtable hijacking and arbitrary code execution, potentially escaping the sandbox.
What the attacker needed
Android device; victim grants tab capture; attacker triggers renderer crash; mouse movement over captured area
The fix
The fix should either change the raw pointer to a MiraclePtr (raw_ptr) or implement explicit cleanup by observing view destruction to reset pointers immediately.
How it was found
- An attacker tricks a user into visiting a malicious site on an Android device and granting tab capture permissions.
- The attacker's JavaScript initiates the capture, causing the browser to set up the MouseCursorOverlayController.
- The attacker intentionally triggers a renderer process crash.
- The attacker simultaneously simulates or induces mouse movement over the captured area.
- The browser process reads the dangling ui::ViewAndroid pointer, resulting in a UAF when GetDipScale() is called.
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 you share a tab on Android, the browser draws a mouse cursor overlay. If the page crashes, a pointer to the overlay's view is not cleared, so later mouse movements can access freed memory. This is called a use-after-free, and it can let an attacker run their own code in the browser.
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.