Inappropriate implementation in File Picker (CVE-2025-8881)
A compromised renderer can perform credentialed cross-site downloads and open file pickers with a prefilled filename, allowing an attacker to upload the downloaded file to their page with only the user holding the enter key. This bypasses user activation checks and the download throttler.
Originally disclosed on Chrome VRP
- Fix shipped in 21 days
SUMMARY
With a compromised renderer, a page can perform a credentialed download of a cross-site URL and then upload the downloaded response. The only user interaction needed is holding the enter key. The attack works for single files or multiple files.
To perform the attack, the PoCs performs these steps without user interaction:
- Downloads one or more credentialed cross-site URLs, without user interaction.
- Opens file pickers with filename prefilled with the download's predicted filename, also without user interaction.
We also bypass the user activation checks of several gated features. The only user interaction needed is holding enter to press the "Open" button in the file pickers.
This is an improved report chaining several behaviors to minimize user interaction, based on earlier research in issue 428189828.
VULNERABILITY DETAILS
Download credentialed cross-site URL
A compromised renderer can call DownloadURL() to initiate a credentialed download of a cross-site URL without user interaction. Cross-site URL downloads are credentialed and all cookies except SameSite=Strict cookies are sent. We can do this for multiple URLs when we bypass the download throttler. (I previously mentioned using DownloadURL() in https://crbug.com/428189828#comment4 )
Due to browser-side checks, we cannot set the download filename, but we can accurately predict the filename since it's generated based on the URL path (see getPredictedFilename() in PoC source for details).
Download throttler bypass
For the multiple files scenario, we need to bypass the download throttler which limits downloads to one per WebContents (window or tab). To bypass the download throttler, the compromised renderer calls LocalFrame::NotifyUserInteraction() followed by window.open() to create a popup without user interaction. We repeat this for as many downloads as we need. (Download throttle bypass used to be easier.)
Set filename in open file picker
For security reasons, the open file picker isn't usually allowed to have a prefilled filename. However, there are no browser-side checks to enforce this in the file-type input code path, so a compromised renderer can call OpenFileChooser() with default_file_name to set the prefilled filename (absolute paths are rejected by browser). We set this to the download's filename to automatically select the downloaded file in the open file picker dialog.
In comparison, the FSA API browser-side code ignores any filename provided by renderer when using the Open dialog.
This behavior could be a standalone vulnerability since this may be useful in other attack scenarios; let me know if I should file separate crbug for this.
User activation bypasses
To bypass various user activation checks to show file pickers, open popups, and start downloads, the compromised renderer calls LocalFrame::NotifyUserInteraction(). This is a known issue.
Mitigation: Last selected directory
There is a notable mitigation: The attack's happy path depends on the browser profile's last_selected_directory() being set to the user's downloads folder (on Windows, Chromium's default download folder is %userprofile%/Downloads/). This value is set when a user selects a file using certain open file pickers, including the one used by OpenFileChooser() (see callers of set_last_selected_directory()).
In the PoC, we try to detect if the last selected folder is not the downloads folder by checking if a file isn't selected within a couple of seconds. After the timeout, we ask the user to select their downloads folder and click "Open". Since the filename is prefilled, there's no need to click a specific file.
If mitigated due to a non-downloads folder, we can try to salvage the attack attempt:
-
For the single file scenario, if we hit the non-downloads folder case, the attack becomes largely moot. The only attacker benefit is the prefilled filename. The page could try to convince the user they're uploading a "verification" file, but this may raise suspicion and the same goal can be achieved with pure social engineering.
-
For the multiple file scenario, if we hit the non-downloads folder case, an attacker can still benefit. If the attacker convinces user to select the first file from the downloads folder, which can be an innocuous file, then holding the enter key will result in a successful attack for an unlimited number of files. The first step may raise suspicion for some users, but if the attacker succeeds there, the rest of the attack is less visible and very likely to be successful.
Anecdotally, most of the files I upload are from my downloads folder (downloading from website A to upload to website B). This may also be the case for many users who frequently download/upload PDFs, CSVs, images, etc. across websites in a similar manner.
PROPOSED FIXES
There's several things that can be fixed, to break the chain and also mitigate any standalone impacts:
-
Prevent cross-site credentialed downloads initiated by user or compromised renderer, through Alt+Click/Enter or directly through
DownloadURL()respectively. This work is tracked in issue 428189828 per https://crbug.com/428189828#comment3, but as a non-security bug. This should break any variants that depend on cross-site credentialed download, such as the one reported in that other issue. -
Ensure browser ignores
default_file_nameinOpenFileChooser()params from renderer if the chooser isn't inkSavemode. This is what the FSA API currently does. -
Longer-term: Implement browser-enforced user activation, to avoid bypasses when showing file pickers, opening popups, or starting downloads. This is a known issue but there are some features which currently have robust mitigations by checking
WebContents::HasRecentInteraction(). Of all three actions the browser could restrict, file pickers is probably the least risky option.
VERSION
Chrome version:
- Cross-site credentialed download: 138.0.7204.169 Stable, 140.0.7313.0 Canary
- Set filename in file picker: Verified with custom build based on
aad34245b04df3c637ce7c51b5a10af879e1ac98(July 3rd)
Operating System: Windows 10
REPRODUCTION CASE
General notes:
- The repro shown in videos is slower than the actual repro time, due to resource constraints caused by video recording.
- In this PoC, we wait for user to interact with page before initiating downloads, but compromised renderer can perform multiple downloads at any time. We wait to avoid user suspicion before user interacts with page.
Patch to simulate compromised renderer
To simulate a compromised renderer, the patch:
- Disables some browser DCHECKs in
chrome/browser/file_select_helper.ccandui/shell_dialogs/base_shell_dialog_win.cc. You can alternatively build with DCHECKs disabled. - Updates
third_party/blink/renderer/core/html/html_marquee_element.ccto callNotifyUserActivation()whenmarqueeElem.stop()is called in JS, to bypass user activation checks. - Updates
third_party/blink/renderer/core/html/forms/file_input_type.ccto callDownloadURL()directly and setdefault_file_namein open file picker. See patch comments for how to use attributes to change behavior.
Setup for both PoCs:
- If self-hosting or want to edit using DevTools, optionally configure the target URL in the source code (e.g.
https://myaccount.google.com/personal-info). - If using default target (such as on hosted PoC), navigate to https://aogarantiza.com/set-cookies.php to set cookies on target.
- Apply attached patch and build Chromium.
Scenario: Single file
Using patched browser:
- Navigate to https://alesandroortiz.com/security/chromium/download-cross-site-theft-cr.html
- Press and hold enter.
- For happy path: Wait for attack to complete within a couple of seconds.
- For sad path (non-downloads folder case): Select downloads folder, then click "Open" button.
Scenario: Multiple files
Using patched browser:
- Navigate to https://alesandroortiz.com/security/chromium/download-cross-site-theft-cr-multiple.html
- Press and hold enter.
- For happy path: Wait for attack to complete within a few seconds.
- For sad path (non-downloads folder case): Select downloads folder, then click "Open" button. Then continue from step 2 into happy path.
For both scenarios:
Observed: Compromised renderer can download multiple cross-site credentialed URLs and show open file pickers with prefilled filename. Because user is holding enter, the downloaded file is uploaded to attacker page shortly after file picker is shown.
Expected: Cross-site downloads are not credentialed, for downloads initiated by either regular or compromised renderers. Compromised renderer cannot show open file pickers with prefilled filename. To a lesser extent, a compromised renderer should not be able to download multiple files by bypassing popup blocker.
Credit Information
Reporter credit: Alesandro Ortiz https://AlesandroOrtiz.com
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 browser trusts the renderer to set the default filename in file pickers and to signal user interaction, and it allows credentialed cross-site downloads without sufficient browser-side checks.
Impact
An attacker could steal files from a user's downloads folder or other locations by uploading them to an attacker-controlled page, with minimal user interaction (holding enter). The attack is mitigated if the last selected directory is not the downloads folder, but can still succeed with additional social engineering.
What the attacker needed
Compromised renderer; user holds enter key; last selected directory is downloads folder
How it was found
- Navigate to the PoC page in a patched browser.
- Press and hold the enter key.
- Wait for the attack to complete, or if the last selected folder is not downloads, select the downloads folder and click Open.
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 compromised renderer means the part of the browser that runs web page code has been taken over by an attacker. The attacker can make the browser download files from other sites while sending the user's cookies, then trick the user into uploading those files back to the attacker by holding the enter key. This lets the attacker steal data the user is logged into on other sites.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.