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

Incorrect reference resolution in FileSystem (CVE-2026-87547)

The File System Access API on Android skips validation of the child entry name when the directory is backed by a Content URI, allowing a malicious renderer to pass path traversal sequences to external DocumentsProviders. If a provider lacks its own sanitisation, this could let an attacker create files outside the user-approved directory scope.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 5 months

Project Fortify, an experimental security project, has identified the following potential security issue.

Overview: The File System Access API on Android fails to validate the child entry name (basename) when interacting with Content URI-backed directories. This potential flaw allows a malicious renderer to pass path traversal sequences directly to external Android DocumentsProviders. If the provider lacks its own sanitization, this bypasses directory scoping guarantees and escapes the sandbox.

Affected files:

  • content/browser/file_system_access/file_system_access_directory_handle_impl.cc

Estimated timestamp from git blame: 2025-03-17

Summary There is a potential path validation bypass in the File System Access API implementation on Android. When a renderer requests a file, directory, or deletion using a basename, the browser-side implementation is supposed to validate this component using manager()->IsSafePathComponent(...) to ensure it does not contain dangerous characters or traversal sequences (e.g., .., /, \). However, on Android, this validation is skipped for Content URIs, and the unvalidated string is passed directly via JNI to Android's DocumentsProvider IPC.

Technical Analysis In content/browser/file_system_access/file_system_access_directory_handle_impl.cc, the methods GetFile, GetDirectory, and RemoveEntry check if the directory handle's path is a Content URI.

C++
// content/browser/file_system_access/file_system_access_directory_handle_impl.cc
void FileSystemAccessDirectoryHandleImpl::GetFile(...) {
#if BUILDFLAG(IS_ANDROID)
  if (url().virtual_path().IsContentUri()) {
    // ...
    base::ThreadPool::PostTaskAndReplyWithResult(
        FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
        base::BindOnce(&base::ContentUriGetChildDocumentOrQuery,
                       url().virtual_path(), basename, mime_type,
                       /*is_directory=*/false, create),
        // ...
    return; // <-- BYPASS: Early return skips validation
  }
#endif

  storage::FileSystemURL child_url;
  blink::mojom::FileSystemAccessErrorPtr get_child_url_result =
      GetChildURL(basename, &child_url); // <-- VALIDATION OCCURS HERE
  // ...
}

When url().virtual_path().IsContentUri() is true, the code immediately posts a task to the ThreadPool and returns. It never reaches the subsequent call to GetChildURL(basename, &child_url), which is where the critical validation occurs via manager()->IsSafePathComponent(...).

By bypassing this check, a compromised renderer (or even standard JavaScript) can pass arbitrary strings as the basename. This string flows through base::ContentUriGetChildDocumentOrQuery into Java (ContentUriUtils.java), where it is eventually passed as the displayName parameter to DocumentsContract.createDocument(resolver, parentUri, mimeType, displayName).

While some system-provided DocumentsProviders may sanitize inputs internally, relying on external third-party providers (such as cloud storage apps or custom file managers) to handle path traversal sequences safely is a "confused deputy" risk that breaks the API's fundamental directory scoping guarantees.

Suggested Steps to Reproduce (Note: These are suggested/potential steps as our tooling agent does not currently have the ability to run code and verify the exploit end-to-end.)

  1. An attacker hosts a malicious webpage that invokes await self.showDirectoryPicker().
  2. The user is prompted and grants access to an Android directory backed by a Content URI (e.g., an external SD card or a third-party DocumentProvider).
  3. The webpage receives the FileSystemDirectoryHandle.
  4. The webpage executes await dirHandle.getFileHandle('../malicious_file', {create: true}).
  5. The ../malicious_file payload is sent unvalidated to the browser, bypassing IsSafePathComponent, and is passed directly to the external DocumentsProvider.
  6. If the provider is vulnerable, it creates a file outside the user-approved directory scope.

Suggested Fix The manager()->IsSafePathComponent(...) check should be decoupled from GetChildURL() or explicitly called at the very beginning of GetFile, GetDirectory, and RemoveEntry before the #if BUILDFLAG(IS_ANDROID) Content URI early-return blocks.

Evaluated with Chrome root at commit: 876d480da1f794d87813cfa2e6ff4fcf9771e939


Results from 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 Android-specific early return in GetFile, GetDirectory, and RemoveEntry skips the IsSafePathComponent validation that normally happens in GetChildURL.

Impact

If the external DocumentsProvider lacks its own sanitisation, an attacker could create files outside the user-approved directory scope, but the report notes that some system providers may sanitise inputs and the exploit was not verified end-to-end.

What the attacker needed

Victim uses Android; victim grants directory access; provider lacks sanitisation

The fix

The IsSafePathComponent check should be called explicitly at the start of GetFile, GetDirectory, and RemoveEntry before the Android Content URI early-return blocks.

How it was found

  1. An attacker hosts a malicious webpage that invokes showDirectoryPicker().
  2. The user grants access to an Android directory backed by a Content URI.
  3. The webpage receives the FileSystemDirectoryHandle.
  4. The webpage calls getFileHandle with a path traversal sequence as the name.
  5. The unvalidated name is passed to the external DocumentsProvider.
  6. If the provider is vulnerable, it creates a file outside the approved directory scope.

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 a website asks to save a file in a folder you picked, the browser is supposed to check that the file name does not contain tricks like '../' that could escape the folder. On Android, for certain folder types, that check is missing, so a malicious website could try to write files outside the folder you chose. This only works if the app managing that folder also fails to block such tricks.

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.