UI misrepresentation in Extensions (CVE-2026-79176)
The chrome.fileSystem.chooseEntry extension API lacks a user gesture requirement and allows a suggestedName to pre-fill the filename in Open dialogs. A malicious or compromised extension could exploit this via UI redress, tricking a user into inadvertently selecting and disclosing a sensitive local file.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 5 months
Flapjack, an experimental security project, has identified the following potential security issue.
Overview: The chrome.fileSystem.chooseEntry extension API lacks a user gesture requirement and allows a suggestedName to pre-fill the filename in "Open" dialogs. A malicious or compromised extension can exploit this via UI redress, tricking a user into inadvertently selecting and disclosing a sensitive local file.
Affected files:
extensions/browser/api/file_system/file_system_api.ccchrome/browser/extensions/api/file_system/file_entry_picker.cc
Estimated timestamp from git blame: 2023-03-01
Description
The chrome.fileSystem.chooseEntry extension API (implemented in FileSystemChooseEntryFunction in extensions/browser/api/file_system/file_system_api.cc) allows a caller to specify a suggestedName in the ChooseEntryOptions. This suggested name is processed and utilized even when the picker type is openFile or openWritableFile.
In extensions/browser/api/file_system/file_system_api.cc:
- The
Run()method processes the user-providedsuggested_nameviaBuildSuggestion. - It then calls
CalculateInitialPathAndShowPicker, which appends the suggested name to the initial directory path. - This combined path is passed to
ShowSelectFileDialogin theFileSystemDelegate.
In the Chrome-specific implementation (chrome/browser/extensions/api/file_system/file_entry_picker.cc), this path is passed as the default_path to the native SelectFileDialog::SelectFile. On most platforms, including Windows, this causes the native "Open" dialog to pre-fill the "File name" box with the provided filename, even though it is an "Open" dialog rather than a "Save" dialog.
Crucially, FileSystemChooseEntryFunction::Run() lacks a browser-side check for a user gesture (e.g., it is missing a user_gesture() or EXTENSION_FUNCTION_VALIDATE(has_user_gesture()) call). This allows a compromised extension renderer with the fileSystem permission (such as the PDF Viewer, or a malicious platform app) to trigger the file picker dialog unexpectedly at any time.
Potential Attack Scenario
(Note: These are potential steps based on static analysis, as our tooling does not currently run exploit code.)
- An attacker compromises an extension with the
fileSystempermission or convinces the user to install a malicious platform app. - The attacker predicts the filename of a sensitive file in a known default directory (e.g., a credential file).
- The attacker's extension prompts the user to engage in an activity requiring rapid or sustained key presses (e.g., repeatedly pressing the "Enter" key in a game).
- While the user is pressing "Enter", the attacker's JavaScript programmatically calls
chrome.fileSystem.chooseEntry({type: 'openFile', suggestedName: 'credentials.json'}). - Because there is no user gesture requirement, the native "Open File" dialog appears instantly, stealing window focus.
- The "File name" input box is pre-filled with
credentials.json. - The user's ongoing "Enter" keystroke is consumed by the dialog's default "Open" button before they can react.
- The dialog closes, and the API returns a
FileEntryfor the sensitive file to the attacker's JavaScript callback, granting unauthorized read access.
Suggested Fix
- Require a User Gesture: Add a check for user activation in
FileSystemChooseEntryFunction::Run(). For example:C++ if (!user_gesture()) { return RespondNow(Error("User gesture is required")); } - Ignore
suggestedNamefor Open Dialogs: Modify the API implementation so that thesuggestedNameparameter is only used when the picker type iskSaveFile. ForkOpenFileandkOpenWritableFile, thesuggestedNameshould be ignored so the native dialog does not pre-fill a filename.
Evaluated with Chrome root at commit: 876d480da1f794d87813cfa2e6ff4fcf9771e939
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.
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 API does not check for a user gesture before showing the file picker, and it uses the suggestedName even for open dialogs, allowing a malicious extension to pre-fill the filename and trick the user into selecting a sensitive file.
Impact
A malicious or compromised extension could trick a user into inadvertently selecting and disclosing a sensitive local file, granting the extension unauthorised read access.
What the attacker needed
Extension with fileSystem permission; user installs or is tricked into using extension; user performs rapid key presses
The fix
The API should require a user gesture before showing the file picker and ignore the suggestedName parameter for open dialogs.
How it was found
- An attacker compromises an extension with the fileSystem permission or convinces the user to install a malicious platform app.
- The attacker predicts the filename of a sensitive file in a known default directory.
- The attacker's extension prompts the user to engage in an activity requiring rapid or sustained key presses.
- While the user is pressing Enter, the attacker's JavaScript programmatically calls chrome.fileSystem.chooseEntry with a suggestedName.
- Because there is no user gesture requirement, the native Open File dialog appears instantly, stealing window focus.
- The File name input box is pre-filled with the suggested name, and the user's ongoing Enter keystroke is consumed by the dialog's default Open button, closing the dialog and returning a FileEntry for the sensitive 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.
This is about a Chrome extension feature that lets an extension open a file picker dialog. Normally, a dialog should only appear after you click something, but here the extension can open it at any time. Also, the dialog can be made to show a specific filename already typed in, so if you are pressing Enter repeatedly, you might accidentally open a sensitive file and hand it to the extension.
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.