Incorrect authorization in FileSystem (CVE-2026-79143)
A logic error in the File System Access API causes the Safe Browsing dangerous-file warning to be skipped when a site creates a new file through a directory handle. An attacker with directory write access could silently drop executable files such as .exe without the usual confirmation dialog.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 months
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 logic error in the File System Access API allows sites with directory write access to silently create executable files (like .exe) without triggering the Safe Browsing warning dialog. This occurs because getFileHandle incorrectly passes UserAction::kNone during sensitive entry checks.
Affected files:
content/browser/file_system_access/file_system_access_directory_handle_impl.ccchrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
Estimated timestamp from git blame: 2024-10-03
Description
A potential logic error exists in the File System Access API that bypasses the Safe Browsing 'Dangerous File Type' warning when creating new files via a directory handle.
When directoryHandle.getFileHandle(name, {create: true}) is called, the system performs a sensitive entry access check to ensure the file path is safe. However, in FileSystemAccessDirectoryHandleImpl::GetFileResolved, this check is initiated with UserAction::kNone instead of UserAction::kSave.
In ChromeFileSystemAccessPermissionContext::DidCheckPathAgainstBlocklist, an action level of kNone triggers an early return. This completely bypasses the subsequent logic designed to display the FileSystemAccessDangerousFileDialog for file extensions with a DangerLevel of ALLOW_ON_USER_GESTURE (which includes .exe, .bat, .sh, .jar, etc., on their respective platforms).
Because ALLOW_ON_USER_GESTURE files are not blocked by the earlier IsSafePathComponent check (which only blocks strictly DANGEROUS files like .lnk), a malicious site that has obtained a directory handle can silently drop executables without the standard user confirmation dialog.
Potential Reproduction Steps
(Note: These are suggested steps; our tooling has not executed a live PoC.)
- An attacker hosts a malicious website and tricks a user into granting write access to a local directory (e.g., their Downloads or Desktop folder) using
window.showDirectoryPicker({mode: 'readwrite'}). - The malicious site executes
const fileHandle = await directoryHandle.getFileHandle("payload.exe", {create: true});. - The browser processes this in
FileSystemAccessDirectoryHandleImpl::GetFileResolved. It callsConfirmSensitiveEntryAccesswithUserAction::kNone. - In
DidCheckPathAgainstBlocklist, theuser_action == UserAction::kNonecheck causes an early return, bypassing theALLOW_ON_USER_GESTUREprompt for the.exefile. - The site successfully gets the handle and can write malware into
payload.exeusingcreateWritable(). - The executable is dropped onto the user's filesystem without the intended defense-in-depth warning.
Technical Details
In content/browser/file_system_access/file_system_access_directory_handle_impl.cc (GetFileResolved):
manager()->permission_context()->ConfirmSensitiveEntryAccess(
context().storage_key.origin(), path_info, HandleType::kFile,
UserAction::kNone, context().frame_id, // <-- Flaw: kNone used instead of kSave
base::BindOnce(&FileSystemAccessDirectoryHandleImpl::DoGetFile, ...));
In chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc (DidCheckPathAgainstBlocklist):
if (user_action == UserAction::kNone) {
std::move(callback).Run(should_block ? SensitiveEntryResult::kAbort
: SensitiveEntryResult::kAllowed);
return; // <-- Early return bypasses the dialog below
}
// ... later in the function ...
#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
// If attempting to save a file with a dangerous extension, prompt the user...
if (handle_type == HandleType::kFile && user_action == UserAction::kSave) {
// Shows FileSystemAccessDangerousFileDialog if ALLOW_ON_USER_GESTURE
Suggested Fix
Update FileSystemAccessDirectoryHandleImpl::GetFileResolved to pass UserAction::kSave instead of UserAction::kNone when create is true. This aligns the behavior with other API surfaces like move(), ensuring the Safe Browsing warning is properly displayed when dangerous files are created.
Evaluated with Chrome root at commit: b7d0c4d810da1b31400f198c70d9720fc8f0e5a0
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 directory-handle file creation path passes a 'no user action' value into the sensitive-entry check, and the permission context returns early for that value, so the dangerous-file dialog is never reached.
Impact
A malicious site with directory write access could silently place executable files on the user's filesystem without the intended defence-in-depth warning; the report notes the reproduction steps were not executed as a live proof of concept.
What the attacker needed
Victim grants directory write access; site creates a new file via directory handle; dangerous extension such as .exe
The fix
The directory-handle creation path should pass the save user action instead of the no-action value so the dangerous-file warning is shown.
How it was found
- Trick a user into granting write access to a local directory via the directory picker.
- Call getFileHandle with create set to true for an executable filename.
- The browser runs the sensitive-entry check with the no-action value.
- The permission context returns early and skips the dangerous-file dialog.
- The site obtains the handle and writes the executable content.
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 into a folder you picked, the browser is meant to warn you if the file type is dangerous, like an .exe program. Here, a coding mistake means that warning is skipped when the site creates a brand-new file, so malware could land in your folder without that extra prompt. You still have to have given the site write access to the folder first.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.