Incorrect reference resolution in Extensions (CVE-2026-91727)
A compromised sandboxed macOS child process could plant a symbolic link inside a browser-created temporary directory during a cryptographic verification race window, causing the browser to overwrite arbitrary user-writable files via base::CopyFile following the destination symlink. This could potentially lead to remote code execution in the unsandboxed browser process context.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 4 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 compromised sandboxed macOS child process can potentially escape its sandbox by exploiting a destination symlink-following behavior in base::CopyFile. By planting a symbolic link inside a browser-created temporary directory during a cryptographic verification race window, the sandboxed process can trick the browser process into overwriting arbitrary user-writable files. This can potentially lead to remote code execution in the context of the unsandboxed browser process.
Affected files:
extensions/browser/sandboxed_unpacker.ccbase/files/file_util_apple.mmsandbox/policy/mac/gpu.sbsandbox/policy/mac/network.sbsandbox/policy/mac/on_device_model_execution.sb
Estimated timestamp from git blame: 2024-09-18
Root Cause Analysis
On macOS, the Seatbelt sandbox profiles for the GPU, network service, and on-device model execution processes grant write-create and write-unlink permissions on the entire _CS_DARWIN_USER_TEMP_DIR subtree (configured as the darwin-user-temp-dir parameter):
-
GPU Sandbox (
sandbox/policy/mac/gpu.sblines 124-128):SCHEME (allow file-read* file-write-data file-write-create file-write-owner file-write-unlink (subpath (param darwin-user-temp-dir))) -
Network Sandbox (
sandbox/policy/mac/network.sblines 50-53) and On-Device Model Sandbox (sandbox/policy/mac/on_device_model_execution.sblines 60-64):SCHEME (allow file-read* file-write* (subpath (param darwin-user-temp-dir)))
Because the browser process and these helper processes run under the same user ID (UID), discretionary access control (DAC) permissions of 0700 on temporary directories created by the browser do not prevent sandboxed helper processes from writing to or creating symlinks inside them. Seatbelt gates symlink(2) via file-write-create, which is allowed on the darwin-user-temp-dir subtree. Therefore, a compromised sandboxed child process can create symlinks inside any directory under this temporary path.
SandboxedUnpacker uses this temporary tree for its working directory:
-
In
extensions/browser/sandboxed_unpacker.cc(line 303),CreateTempDirectory()creates a unique directory underDIR_TEMP(which resolves to_CS_DARWIN_USER_TEMP_DIRon macOS):C++ temp_dir_.CreateUniqueTempDirUnderPath(temp_dir); -
It verifies the signature of the CRX package using
ValidateSignature()(line 311). This process involves RSA/ECDSA verification and parsing, representing a significant race window (milliseconds to hundreds of milliseconds). -
After verification, it prepares to copy the file to the temporary directory:
C++ base::FilePath temp_crx_path = temp_dir_.GetPath().Append(crx_info.path.BaseName()); -
It copies the CRX package using
base::CopyFile:C++ base::CopyFile(crx_info.path, temp_crx_path);
Vulnerability #1: Target Symlink Following in base::CopyFile
On macOS, base::CopyFile is implemented using Apple's copyfile() without the COPYFILE_NOFOLLOW_DST flag in base/files/file_util_apple.mm (lines 20-27):
bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
ScopedBlockingCall scoped_blocking_call(FROM_HERE, BlockingType::MAY_BLOCK);
if (from_path.ReferencesParent() || to_path.ReferencesParent()) {
return false;
}
return (copyfile(from_path.value().c_str(), to_path.value().c_str(),
/*state=*/nullptr, COPYFILE_DATA) == 0);
}
Because COPYFILE_NOFOLLOW_DST is missing, copyfile will follow a destination symlink and overwrite the target file.
Vulnerability #2: Target Resolution Pivot in NormalizeFilePath
Immediately after copying, SandboxedUnpacker resolves the path using NormalizeFilePath() (line 332), which uses realpath() on POSIX platforms:
base::FilePath normalized_crx_path = NormalizeFilePath(temp_crx_path);
base::FilePath unzipped_dir =
normalized_crx_path.DirName().AppendASCII(kTempExtensionName);
If temp_crx_path is a symlink, realpath() resolves it to the target file's path. Consequently, unzipped_dir is computed relative to the directory containing the target file, and the browser proceeds to extract the CRX ZIP contents there.
Potential Attack Scenario / Suggested Exploitation Flow
Please note that these are suggested/potential steps, as our testing environment and tooling do not currently have the capability to run code or execute a live proof of concept.
- An attacker compromises one of the sandboxed helper processes (GPU, network, or on-device model execution) and starts a file system watcher on the
_CS_DARWIN_USER_TEMP_DIRsubtree. - The browser initiates a CRX package download and unpack operation (such as during an extension auto-update check).
- A new browser-privileged temporary directory (
scoped_dirXXXXXX) is created under the temporary directory. - During the cryptographic verification race window inside
ValidateSignature(), the compromised child process creates a symlink at<darwin-temp>/scoped_dirXXXXXX/<crx_basename>pointing to a sensitive user-writable file (such as~/.zshrc, a LaunchAgent plist, or shell profiles). - When verification succeeds,
base::CopyFile()is invoked by the browser process. It follows the symlink and overwrites the target file with the attacker-controlled CRX payload. NormalizeFilePath()resolves the symlink, prompting the browser to unzip the CRX contents into the directory containing the target file (e.g.,~/_temp_extension/).- The overwritten configuration file (e.g.,
~/.zshrc) is parsed and executed the next time a shell or process is spawned, potentially completing a full sandbox escape to the unsandboxed browser process context.
Suggested Fix
-
Modify
base::CopyFileinbase/files/file_util_apple.mmto include theCOPYFILE_NOFOLLOW_DSTflag, preventingcopyfilefrom resolving symbolic links at the destination:C++ bool CopyFile(const FilePath& from_path, const FilePath& to_path) { ScopedBlockingCall scoped_blocking_call(FROM_HERE, BlockingType::MAY_BLOCK); if (from_path.ReferencesParent() || to_path.ReferencesParent()) { return false; } return (copyfile(from_path.value().c_str(), to_path.value().c_str(), /*state=*/nullptr, COPYFILE_DATA | COPYFILE_NOFOLLOW_DST) == 0); } -
Additionally, consider checking that
temp_crx_pathis not a symbolic link (usingbase::IsLink()) insideSandboxedUnpacker::StartWithCrx()before invoking file operations.
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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.
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 combination of overly broad sandbox write permissions on the shared temporary directory and base::CopyFile not using COPYFILE_NOFOLLOW_DST, allowing a symlink planted during the signature verification race window to redirect the copy.
Impact
A compromised sandboxed child process could potentially escape its sandbox and achieve remote code execution in the unsandboxed browser process context by overwriting user-writable files such as shell profiles.
What the attacker needed
Compromised sandboxed helper process; macOS with Seatbelt sandbox; browser initiates CRX unpack; race window during signature verification
The fix
base::CopyFile should be modified to include the COPYFILE_NOFOLLOW_DST flag, and SandboxedUnpacker should check that the temporary CRX path is not a symbolic link before file operations.
How it was found
- Compromise a sandboxed helper process and start a file system watcher on the temporary directory subtree.
- Trigger a CRX package download and unpack operation in the browser.
- Wait for a new browser-privileged temporary directory to be created.
- During the signature verification race window, create a symlink at the expected CRX path pointing to a sensitive user-writable file.
- When verification succeeds, base::CopyFile follows the symlink and overwrites the target file with the attacker-controlled CRX payload.
- NormalizeFilePath resolves the symlink, causing the browser to unzip the CRX contents into the directory containing the target file.
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 sandboxed helper process on macOS is supposed to be isolated, but it can still write to a shared temporary folder. If it creates a shortcut (symbolic link) there that points to a sensitive file like a shell profile, the main browser process may follow that shortcut and overwrite the real file. The attacker then gets their code run outside the sandbox.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.