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

Race in Updater (CVE-2026-17654)

The macOS Chromium updater gives an unprivileged network worker process a writable handle to the file it downloads, and that handle stays valid after the file is moved into the update cache. A compromised worker could keep the handle and overwrite the update after its signature is checked but before it is unpacked, potentially running code as root.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 50 days

Flapjack, 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: A potential Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in the macOS Chromium updater. The root-privileged updater passes a writable file descriptor to a lower-privileged net-worker process, which can retain the descriptor even after the file is moved to the update cache. A compromised worker could overwrite the update payload after signature verification but before extraction, potentially leading to arbitrary code execution as root.

Affected files:

  • chrome/updater/net/network_fetcher_mac.mm
  • chrome/updater/net/mac/mojom/updater_fetcher.mojom

Estimated timestamp from git blame: 2024-08-05

Description

A Time-of-Check to Time-of-Use (TOCTOU) vulnerability in the macOS updater design could allow a local attacker to escalate privileges to root.

When downloading an update, the root-privileged updater spawns an unprivileged net-worker process to handle the network request. To receive the downloaded data, the updater creates a temporary file with write permissions (base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_WRITE) and passes the file descriptor to the net-worker via Mojo.

Once the download completes, the root updater moves the file into the CrxCache using base::Move. On POSIX systems, if the temporary directory and the cache directory are on the same filesystem (which is standard on macOS APFS), base::Move uses the rename() system call. rename() changes the file path but preserves the underlying inode.

Because the inode remains the same, an attacker who compromises the net-worker can duplicate (dup()) the writable file descriptor before the download completes. After the root updater verifies the file's cryptographic signature (Time-of-Check), the attacker can use the retained file descriptor to overwrite the file with a malicious payload before the updater extracts and installs it (Time-of-Use).

Suggested Attacker Steps

Note: These are potential steps based on static code analysis. Our tooling agent does not currently have the ability to run code or provide a working Proof of Concept.

  1. Compromise the net-worker: The attacker obtains code execution within the unprivileged net-worker process (e.g., via a sandbox escape from a renderer process to the local console user).
  2. Intercept the File Descriptor: When the root updater calls FetchService::DownloadToFile, the net-worker receives a writable base::File. The attacker executes a dup() system call to retain a persistent, writable handle to this file descriptor.
  3. Provide a Valid Payload: The attacker writes a legitimately signed Google update CRX into the file so that it passes initial security checks, and signals download completion via Mojo.
  4. Wait for Move and Verify: The root updater calls CrxCache::Put (which calls rename()), and then Unpacker::Verify successfully validates the signed payload.
  5. Trigger the Race Condition (TOCTOU): Immediately after verification succeeds and before Unpacker::BeginUnzipping begins extraction, the attacker uses the duplicated file descriptor to overwrite the file contents with a malicious ZIP archive.
  6. Achieve Privilege Escalation: The root updater currently performs ZIP extraction in-process (OutOfProcessUnzipper::Unzip). It extracts the maliciously modified installer and executes it, resulting in arbitrary code execution as root.

Code References

  • OutOfProcessNetworkFetcher::DownloadToFile explicitly creates the file with base::File::FLAG_WRITE and passes it over Mojo (chrome/updater/net/network_fetcher_mac.mm).
  • CrxCacheImpl::Put uses base::Move to relocate the file, which preserves the inode (components/update_client/crx_cache.cc).
  • Unpacker::Verify validates the signature before unzipping (components/update_client/unpacker.cc), creating the TOCTOU window.

Suggested Fix

There are two primary ways to resolve this issue:

  1. Avoid shared writable file descriptors: Modify the architecture so the net-worker does not write directly to a file. Instead, the net-worker should stream the downloaded bytes back to the parent process via a Mojo data pipe, and the root process should write the bytes to disk itself.
  2. Break the inode link: In CrxCacheImpl::Put, do not use base::Move for files coming from untrusted sources. Instead, use base::CopyFile followed by deleting the original. This ensures the cached file has a brand-new inode that no unprivileged process holds an open handle to.

Evaluated with Chrome root at commit: 2155cb00003ec35716a76ed3246eae995f87b7ff


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 design passes a writable file descriptor to a lower-privileged process and then relocates the same file with rename(), which keeps the same underlying file object reachable through the retained handle.

Impact

A local attacker who has already compromised the network worker could potentially gain arbitrary code execution as root; the report notes this is based on static analysis and no working proof of concept was run.

What the attacker needed

Code execution in the net-worker process; macOS with updater and cache on same filesystem

The fix

The report suggests either streaming downloaded bytes back to the root process through a data pipe so it writes the file itself, or copying the file to a new inode instead of moving it.

How it was found

  1. Get code execution inside the unprivileged net-worker process.
  2. Duplicate the writable file descriptor the worker receives during the download.
  3. Write a legitimately signed update into the file and signal completion.
  4. Let the root updater move the file into the cache and verify its signature.
  5. After verification and before extraction, overwrite the file through the retained descriptor with a malicious archive.
  6. The root updater extracts and runs the modified installer.

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.

An updater runs with high privileges and asks a less trusted helper program to download a file. The helper is handed a way to write to that file, and that access does not go away when the file is moved. If the helper is taken over, it can swap the file's contents after the updater has checked it is genuine, so the updater installs something malicious with high privileges.

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.