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

Race condition in FileSystem (CVE-2026-93380)

A race condition in the File System Access API allows a compromised renderer to bypass Safe Browsing checks by writing a malicious payload after an empty file has been hashed but before it is moved to its final location. An attacker could deliver malware to a user-approved location.

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 security team.

Overview: A potential Time-of-Check Time-of-Use (TOCTOU) race condition exists in FileSystemAccessFileWriterImpl when handling Mojo IPCs from a compromised renderer. An attacker can initiate a Safe Browsing hash check on an empty file while asynchronously writing a malicious payload to it before the file is finalized. This completely bypasses the Safe Browsing after-write protection, allowing malware delivery to user-approved locations.

Affected files:

  • content/browser/file_system_access/file_system_access_file_writer_impl.cc
  • content/browser/file_system_access/file_system_access_safe_move_helper.cc
  • chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc

Estimated timestamp from git blame: 2025-08-22

Vulnerability Summary

There is a potential Time-of-Check Time-of-Use (TOCTOU) race condition in FileSystemAccessFileWriterImpl that allows a compromised renderer to bypass Safe Browsing "after-write" checks.

When a renderer calls Close(), the browser immediately initiates a Safe Browsing check (computing the file's hash) via FileSystemAccessSafeMoveHelper. However, CloseImpl does not wait for pending Write operations to complete. By sending a Write IPC with an open but empty Mojo data pipe immediately followed by a Close IPC, an attacker can trick the browser into calculating a safe hash for an empty file. While the Safe Browsing network request is in flight, the attacker can stream a malicious payload into the data pipe, writing it to the swap file. When the "SAFE" verdict for the empty file returns, the now-malicious swap file is moved to its final destination.

Note: These steps are based on static code analysis by an AI tooling agent; we do not yet have a working proof-of-concept to run.

Potential Attacker Steps

  1. Compromise Renderer: An attacker gains code execution in the renderer process (e.g., via a v8 exploit).
  2. Obtain Write Access: The renderer triggers a showSaveFilePicker() prompt. The user approves it, granting write access to a target location (e.g., C:\Users\User\Downloads\target.exe).
  3. Create Empty Data Pipe: The compromised renderer creates a Mojo data pipe. It deliberately keeps the producer handle open but writes zero bytes into it.
  4. Send Write IPC: The renderer sends a Write(offset=0, stream=<data_pipe_consumer>) IPC to FileSystemAccessFileWriterImpl.
  5. Write Dispatch: In the browser, WriteImpl dispatches a WriteStream operation to the IO thread. The storage::FileWriterDelegate finds the pipe empty, returns MOJO_RESULT_SHOULD_WAIT, and arms a mojo::SimpleWatcher to wait for data. The swap file on disk is still 0 bytes.
  6. Send Close IPC (The Race): Immediately after the Write IPC, the renderer sends a Close() IPC.
  7. Premature Hash Calculation: CloseImpl executes on the UI thread. It fails to check for pending writes and immediately starts FileSystemAccessSafeMoveHelper. On the IO thread, HashCalculator opens the 0-byte swap file, computes an empty hash, and sends it to Safe Browsing.
  8. Payload Delivery: While the Safe Browsing network request is pending, the renderer writes its malicious executable payload into the open Mojo data pipe.
  9. Write Completion: The FileWriterDelegate's watcher fires, reads the malicious payload, and writes it directly to the active swap file.
  10. Bypass Success: The Safe Browsing service evaluates the empty hash and returns a "SAFE" verdict. FileSystemAccessSafeMoveHelper proceeds to move the swap file (which now contains malware) to the user's final chosen destination.

Relevant Code

  • content/browser/file_system_access/file_system_access_file_writer_impl.cc:242-273 - CloseImpl starts FileSystemAccessSafeMoveHelper without checking or waiting for pending WriteState completions.
  • content/browser/file_system_access/file_system_access_safe_move_helper.cc:70-144 - HashCalculator concurrently reads the file while the FileWriterDelegate might still be asynchronously waiting for Mojo data.

Suggested Fix

Modify FileSystemAccessFileWriterImpl to track the number of active, pending write and truncate operations. CloseImpl should not synchronously instantiate and start FileSystemAccessSafeMoveHelper if there are pending operations. Instead, it should set a flag or callback and defer the Safe Browsing checks and the subsequent swap file replacement until the last pending write operation successfully completes (i.e., when DidWrite is called with complete=true and the pending operation count reaches zero).

Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33


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 CloseImpl method starts the Safe Browsing check without waiting for pending write operations to complete, allowing a write to occur after the hash is computed.

Impact

A compromised renderer could bypass Safe Browsing after-write protection and deliver malware to a user-approved location.

What the attacker needed

Compromised renderer; user approves save file prompt

The fix

The fix should make CloseImpl wait for all pending write operations to complete before starting the Safe Browsing check and moving the file.

How it was found

  1. Compromise the renderer process to gain code execution.
  2. Trigger a save file picker and get user approval for write access.
  3. Create a Mojo data pipe and keep the producer handle open without writing data.
  4. Send a Write IPC with the empty data pipe.
  5. Immediately send a Close IPC to start the Safe Browsing check.
  6. While the check is pending, write the malicious payload into the data pipe.

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 save a file through a web app, the browser checks it for malware. This report found a timing flaw: the browser can check an empty file, then the attacker quickly writes malware into it before the check finishes, so the malware gets saved without being scanned. It requires the attacker to already control the web page's code and the user to approve a save.

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.