Open Bug 1688376 Opened 4 years ago Updated 4 years ago

When saving a file to custom location, verify that the requested destination filename is not an existing directory

Categories

(Firefox :: File Handling, enhancement)

Firefox 84
enhancement

Tracking

()

Tracking Status
firefox84 --- affected
firefox85 --- affected
firefox86 --- affected
firefox87 --- affected

People

(Reporter: iochesonome, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0

Steps to reproduce:

On Linux/Arch/Gnome, I hit a bug in GtkFileChooser: https://gitlab.gnome.org/GNOME/gtk/-/issues/3589 (external to Firefox but used by Firefox on my system to ask where to save a file, once the Downloads folder is deselected as the default download location) which made GtkFileChooser return a directory path instead of a valid new file path.
I downloaded a file and triggered the GtkFileChooser bug linked above.

Actual results:

Firefox used this path without fully verifying that it was valid.
Firefox changed the permissions of that directory removing the executable bit. This means that I lost access that directory.

Expected results:

Firefox should have verified if the download path is valid and throw an error message like (message taken from Gedit, which realizes that the path is invalid):

"/.../.../..." is a directory. Please check that you typed the location correctly and try again.

or simply not accept the returned path and open the file save dialog again.

Manage to reproduce this issue on Ubuntu 20.04 x64.

Status: UNCONFIRMED → NEW
Component: Untriaged → File Handling
Ever confirmed: true
You need to log in before you can comment on or make changes to this bug.