UI misrepresentation in FileSystem (CVE-2026-106229)
The File System Access permission dialog and folder upload confirmation dialog on macOS focus the Cancel button but leave the OK button as the default and do not enable input protection. A Return keypress can therefore immediately confirm the dialog, potentially granting persistent read/write file system access or confirming a directory upload without the user's informed consent.
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: FileSystemAccessPermissionDialog and FolderUploadConfirmation dialogs are potentially vulnerable to Enter-keyjacking on macOS. Because these dialogs focus the Cancel button but do not override the default button or enable input event activation protection, a Return/Enter keypress triggers the default OK button. On macOS, this keypress bypasses the minimum-show-time gate, potentially allowing a malicious site to instantly obtain sensitive permissions via a single primed keypress.
Affected files:
chrome/browser/ui/file_system_access/file_system_access_permission_dialog.ccchrome/browser/file_select_helper.cc
Estimated timestamp from git blame: 2022-10-21
Summary
We have identified a potential security UI bypass vulnerability (Enter-keyjacking) affecting the File System Access permission dialog (FileSystemAccessPermissionDialog) and the Folder Upload Confirmation dialog (FolderUploadConfirmation) on macOS.
Due to a platform-specific keyboard event routing behavior on macOS, a user's Return/Enter keypress can trigger the default "OK" button even when the "Cancel" button has active keyboard focus. Because these dialogs lack default button overrides and input activation protection, the triggered Return key event bypasses the standard minimum-show-time safety gate, potentially allowing an attacker to silently and instantly acquire persistent read/write file system access or confirm directory uploads.
Note: Since our testing tools do not currently support running interactive code or UI automation on macOS, these findings represent a static analysis of potential vulnerabilities in the current codebase.
Affected Components and Code Locations
- File System Access Permission Dialog:
chrome/browser/ui/file_system_access/file_system_access_permission_dialog.cc:151-170 - Folder Upload Confirmation Dialog:
chrome/browser/file_select_helper.cc:218-235
Technical Analysis and Root Cause
When these dialogs are built, they set the Cancel button as the initially focused control via .SetInitiallyFocusedField(kCancelButtonId). However, they omit both .OverrideDefaultButton(...) and .SetEnableInputProtection(true).
- Mac-Specific Key Routing:
On macOS,
PlatformStyle::kReturnClicksFocusedControlis defined asfalse(ui/views/style/platform_style.h:56), meaning a Return keypress does not activate a focused non-default button (like the focused "Cancel" button). - Fallback to Default OK Button:
Because the focused Cancel button refuses to consume the Return key, the event falls through to the window's
FocusManager. Since the dialog does not override the default button, the OK button remains the default, registering aVKEY_RETURNaccelerator inLabelButton::SetIsDefault(true)(ui/views/controls/button/label_button.cc:307). The FocusManager therefore routes the Return key to the OK button. - Input Protection Gate Bypass:
When the programmatically triggered click is evaluated in
DialogClientView::ButtonPressed, it queriesIsPossiblyUnintendedInteractioninInputEventActivationProtector(ui/views/input_event_activation_protector.cc:38). Because the dialog model did not callSetEnableInputProtection(true),allow_key_eventsevaluates totrue. Under this condition, the protector immediately returnsfalseon any key event without verifying if the minimum-show-time (the protection duration) has elapsed.
As a result, a fresh Return keypress instantly confirms the dialog regardless of how long the dialog has been visible.
Suggested Exploitation Steps
A potential attack scenario would proceed as follows:
- The attacker's page previously retrieved a
FileSystemFileHandleorFileSystemDirectoryHandle(e.g. from a prior file picker session) and saved it in IndexedDB. - The user visits the page on macOS, and the page displays a social-engineering prompt (e.g., "Click to start, then immediately press Enter to play").
- The user's mouse click satisfies the transient activation requirement, and the page immediately calls
handle.requestPermission({mode: 'readwrite'})or initiates a folder upload. - The tab-modal dialog is instantly shown with the "Cancel" button focused but the "OK" button set as default.
- The user's primed Return keypress bypasses the safety gate and immediately runs the acceptance callback, granting persistent read/write permissions to the attacker.
Suggested Fix
To mitigate this issue, both affected dialog builders should be updated to ensure that keyboard shortcuts cannot accidentally confirm the dialog immediately upon display.
-
Override Default Button: Configure the dialog builder to set the Cancel button as the default dialog button, similar to how it is handled in
FileSystemAccessDangerousFileDialog:C++ dialog_builder.OverrideDefaultButton(ui::mojom::DialogButton::kCancel); -
Enable Input Protection: Explicitly enable input protection to enforce the minimum show-time gate for all inputs, including keyboard shortcuts:
C++ dialog_builder.SetEnableInputProtection(true);
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.
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 dialog builders set the Cancel button as initially focused but fail to override the default button and fail to enable input event activation protection, so a Return keypress falls through to the default OK button and bypasses the minimum-show-time gate.
Impact
A malicious site could instantly obtain persistent read/write file system access or confirm a directory upload via a single primed keypress, but the report notes this is a static analysis and has not been tested on macOS.
What the attacker needed
MacOS; victim has previously granted a file handle; victim clicks and presses Enter
The fix
The dialog builders should override the default button to Cancel and enable input protection so that keyboard shortcuts cannot confirm the dialog immediately upon display.
How it was found
- The attacker's page previously obtained a file or directory handle and saved it in IndexedDB.
- The user visits the page on macOS and sees a social-engineering prompt asking them to click and then press Enter.
- The user's click satisfies the transient activation requirement, and the page calls requestPermission or initiates a folder upload.
- The dialog appears with Cancel focused but OK as the default button.
- The user's primed Return keypress bypasses the safety gate and immediately grants persistent read/write permissions.
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 for permission to access your files, a pop-up dialog appears with 'Cancel' and 'OK' buttons. Normally, pressing Enter should not instantly approve the request, but on macOS, because of how the dialog is set up, a single Enter press can approve it right away. This means a malicious site could trick you into granting file access by getting you to press Enter at the wrong moment.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.