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

Use after free in Downloads (CVE-2026-8522)

A use-after-free flaw in iOS Chrome's download manager arises from a race condition during the dismissal animation of the download UI. An attacker who times a tab closure within the 200ms window could potentially trigger the use of freed memory, leading to remote code execution in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • 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 go/chrome-ai-generated-security-bugs-faq for more information.

Overview: A potential Use-After-Free vulnerability exists in iOS Chrome's Download Manager due to a race condition during the dismissal animation of the download UI. A sequence of downloading, closing the UI, downloading again, and closing the tab can result in a dangling raw pointer that bypasses MiraclePtr and is accessed virtually.

Affected files:

  • ios/chrome/browser/download/coordinator/download_manager_coordinator.mm
  • ios/chrome/browser/download/model/download_manager_tab_helper.mm
  • ios/chrome/browser/download/coordinator/download_manager_mediator.mm
  • ios/chrome/browser/presenters/ui_bundled/vertical_animation_container.mm

Estimated timestamp from git blame: 2025-04-22

Technical Details

A potential Use-After-Free (UAF) vulnerability exists in DownloadManagerCoordinator on iOS. The coordinator manages the lifecycle of the download UI and holds a bare Objective-C pointer to the active web::DownloadTask in the _downloadTask ivar. This pointer is not protected by MiraclePtr (base::raw_ptr).

The vulnerability is triggered by a race condition during the dismissal of the download manager UI:

  1. UI Dismissal Initiated: When a user taps 'Close' on the download bar, DownloadManagerCoordinator calls -pause. This sets _stopped = YES, clears _downloadTask, and initiates a 200ms UIView animation in VerticalAnimationContainer to dismiss the UI.

  2. New Download Arrival: If a new download (D2) arrives while the dismissal animation is still running, didCreateDownload: is called. It updates the raw _downloadTask ivar to point to D2 and calls -restart. Because _stopped is YES and the presenter is still displaying the view controller (as the animation is not finished), -restart sets _restartPending = YES and returns early. Crucially, it does not call _mediator.SetDownloadTask(D2). The mediator (which uses raw_ptr<web::DownloadTask>) never receives a pointer to D2.

  3. Tab Closure: If the tab is closed (e.g., via window.close()) during this same animation window, the WebState detachment process eventually calls DownloadManagerCoordinator::pause. However, because _stopped is already YES, pause returns early (ios/chrome/browser/download/coordinator/download_manager_coordinator.mm:186) without clearing the now-populated _downloadTask or the _restartPending flag.

  4. Task Destruction: When the WebState is destroyed, DownloadManagerTabHelper::WebStateDestroyed clears its std::unique_ptr<web::DownloadTask>, which destroys D2. Since no raw_ptr ever held a reference to D2, the object's BackupRefPtr refcount drops to zero, and the memory is unquarantined.

  5. Use-After-Free: When the 200ms dismissal animation completes, containedPresenterDidDismiss: is called. Seeing _restartPending is YES, it calls -restart, which now proceeds to call _mediator.SetDownloadTask(_downloadTask). This method performs a virtual call (AddObserver) on the freed _downloadTask object through its vtable pointer.

Impact

This vulnerability could potentially allow for Remote Code Execution (RCE) in the browser process of iOS Chrome. An attacker who can time a tab closure within the 200ms window after a user closes the download bar can trigger this UAF. By reclaiming the freed memory with controlled data (e.g., via heap spraying during the animation window), the attacker might gain control of the vtable and redirect execution in the unsandboxed browser process.

Potential Reproduction Steps

  1. Host an attacker-controlled page (T0) that opens a popup (T1).
  2. In T1, trigger a fast download (D1) to show the download bar.
  3. Prompt the user to tap the 'X' button to close the download bar for D1.
  4. In T1, set up a script that triggers a second download (D2) and calls window.close() within the 200ms animation window following the 'X' tap.
  5. Upon completion of the animation, the browser will attempt to use the freed web::DownloadTask object, leading to a crash or code execution.

Suggested Fix

  1. Convert the _downloadTask ivar in DownloadManagerCoordinator from a bare pointer to a base::raw_ptr<web::DownloadTask> or base::WeakPtr<web::DownloadTask> to ensure it is protected by MiraclePtr or safely nullified.
  2. In DownloadManagerCoordinator::pause, do not return early if _stopped is already YES. Ensure _downloadTask and _restartPending are cleared regardless of the _stopped state to prevent dangling pointers and stale state.

Evaluated with Chrome root at commit: 7353d249d9cacf9c7218e1d7b8a39cf39c72d646


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

The download manager coordinator stores a bare Objective-C pointer to the download task that is not protected by MiraclePtr, and its pause method returns early when already stopped, leaving a dangling pointer that is later used after the task is destroyed.

Impact

This could potentially allow remote code execution in the browser process of iOS Chrome if an attacker can time a tab closure within the 200ms window and reclaim the freed memory with controlled data.

What the attacker needed

Victim uses iOS Chrome; victim taps close on download bar; attacker times tab closure within 200ms

The fix

The fix should convert the raw pointer to a protected pointer type and ensure the pause method clears state even when already stopped.

How it was found

  1. Host an attacker-controlled page that opens a popup.
  2. In the popup, trigger a fast download to show the download bar.
  3. Prompt the user to tap the close button on the download bar.
  4. In the popup, set up a script that triggers a second download and calls window.close() within the 200ms animation window.
  5. Upon completion of the animation, the browser attempts to use the freed download task object.

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 keeps a pointer to memory after that memory has been freed, and then tries to use it. Here, the download manager holds a raw pointer to a download task, and during a short animation window, that task can be destroyed while the pointer remains. If an attacker can time things right, they might make the program use the freed memory, which could crash the browser or let them run their own code.

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.