Skip to content
Path traversal Advisory Advanced CVE-2026-17749

Insufficient validation of untrusted input in Extensions (CVE-2026-17749)

A logic error in the chrome.fileSystem API allows a malicious Chrome App to bypass symlink validation using a dangling symlink, because the check short-circuits when the target does not exist. This lets the app create and write to a file outside the user-selected directory, potentially achieving persistent remote code execution.

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

Overview: A logic error in the chrome.fileSystem API allows a malicious Chrome App to bypass symlink validation using a dangling symlink. Because the validation check short-circuits when a symlink target does not exist, the browser process inadvertently creates and grants write access to the target file. This enables an attacker to perform an arbitrary file write outside their sandboxed directory, potentially leading to persistent remote code execution.

Affected files:

  • extensions/browser/api/file_handlers/app_file_handler_util.cc
  • storage/browser/file_system/local_file_stream_writer.cc
  • extensions/browser/api/file_system/file_system_api.cc

Estimated timestamp from git blame: 2015-03-17

Summary

A logic flaw exists in extensions/browser/api/file_handlers/app_file_handler_util.cc that allows a malicious Chrome platform app to bypass symbolic link checks during a chrome.fileSystem.getWritableEntry() call. By leveraging a dangling symlink, an attacker can trick the browser process into creating a file outside the user-selected directory and granting the app write access to it.

Technical Details

The vulnerability stems from the symlink validation logic in PrepareNativeLocalFileForWritableApp:

C++
// Don't allow links.
if (base::PathExists(path) && base::IsLink(path))
  return false;

On POSIX systems, base::PathExists() uses the access() system call, which attempts to resolve and follow symlinks. If the provided path is a dangling symlink (i.e., its target does not yet exist), access() fails and base::PathExists() returns false. Due to C++ short-circuit evaluation, base::IsLink() is never executed, and the dangling symlink completely bypasses the security check.

The function then proceeds to ensure the file exists:

C++
int creation_flags = base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_READ;
base::File file(path, creation_flags);

When base::File processes FLAG_OPEN_ALWAYS on POSIX, it eventually falls back to open(path, open_flags | O_CREAT, mode). Calling open() with O_CREAT on a dangling symlink (without the O_NOFOLLOW flag) causes the OS to follow the symlink and create an empty file at the target location.

The browser process then grants the renderer write access to this path. When the renderer later writes its payload, the storage layer (LocalFileStreamWriter) opens the file—again without O_NOFOLLOW—successfully writing attacker-controlled data to the out-of-bounds target file.

Potential Exploitation Steps

Note: These are suggested steps based on static analysis, as our tooling does not yet execute proof-of-concept exploits.

  1. Setup: A user installs a malicious Chrome App with fileSystem write permissions.
  2. Delivery: The attacker convinces the user to download and extract an archive (using a native OS tool that preserves symlinks) containing a dangling symlink (e.g., evil pointing to /home/chronos/user/.bash_profile).
  3. Selection: The app prompts the user via chrome.fileSystem.chooseEntry({type: 'openDirectory'}) to select the extracted directory.
  4. Escalation: The app calls chrome.fileSystem.getWritableEntry() on the evil symlink.
  5. Trigger: The browser's flawed check passes, and the POSIX open call creates the .bash_profile target.
  6. Write: The app writes a malicious bash payload to the writable entry, achieving an arbitrary file write out of bounds and potential persistent sandbox escape.

Suggested Fix

  1. Correct the Validation Logic: Do not rely on base::PathExists (which follows symlinks) to guard base::IsLink. Unconditionally check base::IsLink(path) first, or use base::GetFileInfo with lstat to securely verify file attributes without following links. For example:

    C++
    if (base::IsLink(path))
      return false;
    
  2. Harden File Creation: Ensure that paths originating from untrusted contexts are opened using the O_NOFOLLOW flag on POSIX to prevent symlink traversal attacks at the storage layer.

Evaluated with Chrome root at commit: 137d451a126685dd5010e6609db9f6d4a78d8234


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

The symlink check used base::PathExists, which follows symlinks and returns false for a dangling link, so the subsequent base::IsLink check was skipped due to short-circuit evaluation.

Impact

An attacker could perform an arbitrary file write outside the sandboxed directory, potentially leading to persistent remote code execution.

What the attacker needed

User installs a malicious Chrome App; app has fileSystem write permissions; user extracts an archive with a dangling symlink; user selects the extracted directory

The fix

The validation logic should unconditionally check base::IsLink first, and file creation should use the O_NOFOLLOW flag on POSIX.

How it was found

  1. A user installs a malicious Chrome App with fileSystem write permissions.
  2. The attacker convinces the user to download and extract an archive containing a dangling symlink.
  3. The app prompts the user to select the extracted directory.
  4. The app calls chrome.fileSystem.getWritableEntry() on the symlink.
  5. The flawed check passes and the POSIX open call creates the target file.
  6. The app writes a malicious payload to the writable entry.

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 symlink is like a shortcut that points to another file. The browser tried to block apps from using symlinks to write outside the folder the user picked, but its check failed when the shortcut pointed to a file that did not exist yet. The app could then create that missing file anywhere and write malicious content into it.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.