Skip to content
Race condition Advisory Advanced CVE-2026-17841

Race in Chrome for iOS (CVE-2026-17841)

Chrome for iOS stages shared files in a single app-wide temporary directory and clears that directory whenever any sharing flow starts. On iPad multi-window, a concurrent window could overwrite a trusted staged file with a malicious one before the user shares it.

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. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: Every SharingCoordinator instance on iOS Chrome stages downloaded files in a shared app-global directory using a server-suggested filename. When a sharing flow begins in one window, it clears the entire directory, which can delete or overwrite active downloads from other concurrent windows. In iPad multi-window layouts, this logic enables a potential race condition allowing content substitution or enterprise policy bypass.

Affected files:

  • ios/chrome/browser/sharing/ui_bundled/sharing_coordinator.mm
  • ios/chrome/browser/sharing/ui_bundled/activity_services/activity_service_coordinator.mm
  • ios/chrome/browser/sharing/ui_bundled/activity_services/data/chrome_activity_file_source.mm
  • ios/chrome/browser/sharing/model/share_file_download_tab_helper.mm

Estimated timestamp from git blame: 2022-10-14

Description

There is a potential race condition and insecure temporary file logic vulnerability (CWE-377 / CWE-367) in Google Chrome for iOS's SharingCoordinator. Because iOS Chrome supports iPad multi-window layouts (Split View / Stage Manager), multiple browser windows can run concurrently within the same OS process and share the same container and NSTemporaryDirectory() path.

When a user initiates a share on an exportable document (e.g. PDF, image, Word doc), the SharingCoordinator stages the downloaded file in a shared, global directory (<tmp>/OpenIn) using a server-suggested filename. However, when starting a new sharing flow, the coordinator unconditionally clears the entire <tmp>/OpenIn directory. This creates a potential Time-of-Check to Time-of-Use (TOCTOU) window where an active download in one window can be deleted or overwritten by a download initiated in a concurrent window.

Technical Analysis

  1. Shared Temporary Directory and Clearing

In ios/chrome/browser/sharing/ui_bundled/sharing_coordinator.mm:

OBJC
static NSString* const kDocumentsTemporaryPath = @"OpenIn";
NSString* GetTemporaryDocumentDirectory() {
  return [NSTemporaryDirectory()
      stringByAppendingPathComponent:kDocumentsTemporaryPath];
}

When any sharing flow starts, CreateDestinationDirectoryAndRemoveObsoleteFiles() is run, which calls RemoveAllStoredDocumentsAtPath to unconditionally delete all files inside <tmp>/OpenIn:

OBJC
BOOL CreateDestinationDirectoryAndRemoveObsoleteFiles() {
  NSString* temporary_directory_path = GetTemporaryDocumentDirectory();
  ...
  // Remove all documents that might be still on temporary storage.
  RemoveAllStoredDocumentsAtPath(temporary_directory_path);
  return YES;
}
  1. Path Resolution and Potential File Overwrite

The target download path is constructed using a suggested filename from the web page/server:

OBJC
self.filePath = [GetTemporaryDocumentDirectory()
    stringByAppendingPathComponent:base::SysUTF16ToNSString(
                                       helper->GetFileNameSuggestion())];

After a file is successfully staged and any Enterprise Data Loss Prevention (DLP) scans complete, the local file URL is wrapped in ChromeActivityFileSource and passed to Apple's native UIActivityViewController (the Share sheet). Because the modal Share sheet is localized to its originating window, the concurrent window remains fully interactive on iPad. This allows a user action or background activity in the second window to trigger a new share/download of a file with the same suggested filename, overwriting the staged file before the user selects a target activity in the first window.

Potential Attack Scenario / Trigger Steps

(Note: These are potential steps based on code analysis; our tooling has not executed a live proof-of-concept).

  1. A user views a trusted document (e.g., invoice.pdf) in Window A and opens the Share sheet. The file is staged at file://.../OpenIn/invoice.pdf and passes any Enterprise scanning controls.
  2. While Window A's Share sheet is open, the user is enticed to interact with an attacker-controlled page in Window B (running side-by-side on iPad), which triggers a download of a malicious file also suggested as invoice.pdf.
  3. Window B's coordinator triggers CreateDestinationDirectoryAndRemoveObsoleteFiles(), deleting Window A's trusted document on disk, and then downloads the malicious document to the exact same path: file://.../OpenIn/invoice.pdf.
  4. The user completes the share action on Window A's Share sheet. The iOS sharing system reads the file content directly from file://.../OpenIn/invoice.pdf at the moment of transmission, resulting in the malicious file being transmitted under the trusted context of Window A.

Suggested Fix

To prevent cross-window clobbering, the SharingCoordinator should isolate each staging session by generating a unique subdirectory (e.g., using a cryptographically secure random UUID) for each coordinator instance:

OBJC
// Example Fix Idea:
NSString* GetTemporaryDocumentDirectory() {
  NSString* uniqueId = [[NSUUID UUID] UUIDString];
  return [[NSTemporaryDirectory() 
      stringByAppendingPathComponent:@"OpenIn"] 
      stringByAppendingPathComponent:uniqueId];
}

When the specific coordinator instance finishes or is destroyed, it should recursively delete only its unique subdirectory, leaving concurrent directories untouched.

Evaluated with Chrome root at commit: fb72408a8493c46bc75fae1c70d03daec96b3040


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 sharing code uses one shared temporary directory and deletes all of its contents at the start of every share, instead of giving each share its own isolated folder.

Impact

A malicious file could be shared under the trusted context of the first window, potentially bypassing enterprise data-loss-prevention checks; the report notes no live proof-of-concept was executed.

What the attacker needed

IPad multi-window (Split View or Stage Manager); victim starts a share in one window; attacker page in a second window; same suggested filename

The fix

The sharing coordinator should give each staging session a unique subdirectory and delete only that subdirectory when the session ends.

How it was found

  1. Open a trusted document in Window A and start the Share sheet, staging the file in the shared temporary folder.
  2. While that sheet is open, interact with an attacker page in Window B that triggers a download with the same suggested filename.
  3. Window B clears the shared folder and writes its file to the same path.
  4. Complete the share in Window A, which sends the file now at that path.

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 tap Share on a file in Chrome, the browser first saves a temporary copy so the share sheet can read it. This report says every Chrome window on an iPad uses the same temporary folder and wipes it each time a new share starts. If two windows are open, one window's share could replace the file the other window is about to send.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.