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

Race condition in Extensions (CVE-2026-91712)

On macOS, the imageWriterPrivate extension API staged temporary files in a shared temp directory writable by sandboxed child processes, then opened files there without O_NOFOLLOW or O_EXCL. A compromised Network or GPU process could plant a symlink so the browser process overwrote arbitrary user files at browser privilege, potentially escaping the sandbox.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 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: A potential sandbox escape and arbitrary file write vulnerability exists in the macOS implementation of the imageWriterPrivate extension API. On macOS, temporary directories are created in a shared location that is write-accessible to sandboxed child processes such as the Network or GPU process. Because the browser process opens files inside this temporary directory without O_NOFOLLOW or O_EXCL flags, a compromised sandboxed process can plant symbolic links to overwrite arbitrary user files at browser privilege.

Affected files:

  • chrome/browser/extensions/api/image_writer_private/tar_extractor.cc
  • chrome/browser/extensions/api/image_writer_private/xz_extractor.cc
  • chrome/browser/extensions/api/image_writer_private/zip_extractor.cc
  • chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc
  • chrome/browser/extensions/api/image_writer_private/operation.cc

Estimated timestamp from git blame: 2013-09-11

Summary

There is a potential sandbox escape/arbitrary file write vulnerability on macOS within the imageWriterPrivate extension API. The vulnerability arises because the browser process stages its temporary files inside _CS_DARWIN_USER_TEMP_DIR (via NSTemporaryDirectory()) and then opens files within that directory using base::File::FLAG_CREATE_ALWAYS (which translates to O_CREAT | O_TRUNC on POSIX) without specifying O_NOFOLLOW or O_EXCL protections.

Since the macOS Seatbelt sandbox profiles for both the Network and GPU processes grant write privileges to the entire _CS_DARWIN_USER_TEMP_DIR subtree, and because these processes run under the same user UID, a compromised sandboxed process can plant symbolic links pointing to sensitive files (e.g., ~/.zshrc or ~/Library/LaunchAgents/*.plist) inside the browser's temporary directory. When the browser process writes to these paths, it follows the symbolic links, overwriting the target files at browser privilege and enabling native code execution outside the sandbox.

Root Cause Analysis

  1. Shared Temporary Directory: In chrome/browser/extensions/api/image_writer_private/operation.cc:117, on macOS the API calls:

    C++
    if (!temp_dir_->CreateUniqueTempDir()) {
    

    This resolves to a subdirectory under NSTemporaryDirectory() (e.g., /var/folders/xx/xxxxxx/T/com.google.Chrome.scoped_dir.XXXXXX). Under the macOS Seatbelt sandbox policies for the Network process (sandbox/policy/mac/network.sb:50-53) and GPU process (sandbox/policy/mac/gpu.sb:124-128), write access is granted to darwin-user-temp-dir. Since the sandboxed processes run as the same UID as the browser, the unique directory's 0700 permissions do not prevent access by sandboxed child processes.

  2. Unsafe File Opening: In chrome/browser/extensions/api/image_writer_private/tar_extractor.cc:105-111 and xz_extractor.cc:94-100, the browser opens the extraction destination file:

    C++
    base::FilePath out_image_path =
        properties_.temp_dir_path.Append(kExtractedBinFileName);
    base::File dst_file(out_image_path,
                        base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE | ...);
    

    base::File::FLAG_CREATE_ALWAYS maps directly to O_CREAT | O_TRUNC in base/files/file_posix.cc:573-577, with no O_NOFOLLOW or safety checks to ensure the path is not a symlink.

Potential Attack Scenario

Note: These steps are theoretical/potential as our tooling does not currently have the capability to run a live proof of concept.

  1. An attacker compromises the sandboxed Network or GPU process.
  2. The attacker's compromised process monitors _CS_DARWIN_USER_TEMP_DIR for the creation of any new directory matching the format com.google.Chrome.scoped_dir.*.
  3. A user runs an allowlisted extension (such as the Chromebook Recovery Utility) that triggers a download and extraction operation via imageWriterPrivate.writeFromUrl.
  4. The compromised child process intercepts the directory creation, and during the download phase, places a symlink: symlink("/Users/<victim>/.zshrc", "<scoped_dir>/extracted.bin").
  5. Upon completion of the download, the browser process opens <scoped_dir>/extracted.bin with FLAG_CREATE_ALWAYS. The system kernel follows the symbolic link, truncating ~/.zshrc to 0 bytes.
  6. The browser process then allows the extraction service to write the archive's payload into the target file descriptor, successfully injecting malicious commands into the user's shell profile.

Suggested Fix

To remediate this issue, the browser process should avoid opening files in shared directories without robust path validation, or should use safe open APIs that prevent symbolic link resolution.

Specifically, when opening files inside the temporary directory, use the O_NOFOLLOW flag or check if the destination path is a symbolic link using base::IsLink / base::GetSymlinkTarget prior to opening it. Alternatively, use helper utilities such as base::File::FLAG_OPEN combined with base::File::FLAG_WIN_EXCLUSIVE_WRITE (which enforces restrictive POSIX locking or secure opening if available), or perform a secure file opening pattern that safely rejects symlinks.

Evaluated with Chrome root at commit: 3947e01999a53d4e2382e39736cb79d79c7dffcf


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 browser opened files in a shared, child-writable temp directory using create-and-truncate flags without refusing to follow symbolic links.

Impact

A compromised sandboxed process could overwrite arbitrary user files at browser privilege, potentially achieving native code execution outside the sandbox; the report notes the steps are theoretical and no live proof of concept was run.

What the attacker needed

Compromised Network or GPU process; user runs an allowlisted extension; macOS

The fix

The browser should open files in shared directories with O_NOFOLLOW or check for symlinks before opening, or use a secure open pattern that rejects symlinks.

How it was found

  1. Compromise the sandboxed Network or GPU process.
  2. Watch the shared temp directory for new scoped temp directories.
  3. A user runs an allowlisted extension that triggers a download and extraction.
  4. Plant a symlink named as the extracted file inside the scoped directory.
  5. The browser opens that path with create-always, following the link and truncating the target file.
  6. The extraction writes the archive payload into the target, injecting commands.

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.

Sandboxed helper processes are meant to be locked down, but here they could still write into a shared temporary folder. The browser then opened files in that folder without checking whether they were really files or links pointing elsewhere. A link (symlink) is like a shortcut; if the browser follows it, it writes to whatever the shortcut points at, such as a shell startup file.

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.