[widget] Extend the use of FOS_NODEREFERENCELINKS on Windows.

In the modern era of user-customizable Quick Access sidebars on every file
dialog, navigating via `.lnk` files is considerably less useful than it
was twenty years ago.

Disable link-following in file-open dialogs by default, to prevent any of
the usual security issues involving symlink smuggling.

Allow overriding this behavior via a pref, for users who want to trade off
this security issue for convenience of being able to follow links inside
file dialogs (older OSes and established user workflows).
Note: File Save dialogs have a set of more nuanced guards against link
smuggling and protected file access; this change doesn't affect that.
This commit is contained in:
Moonchild 2025-04-02 14:31:19 +02:00 • committed by roytam1
commit 1283a5f874
2 changed files with 30 additions and 8 deletions

View file

@ -3635,6 +3635,14 @@ pref("ui.osk.require_win10", false);
// or appearing when it is not expected.
pref("ui.osk.debug.keyboardDisplayReason", "");
// Whether to follow `.lnk` (etc.) shortcuts in the Windows file-open dialog.
//
// Valid values:
// * 0: never
// * 1: always
// * 2: auto
pref("widget.windows.follow_shortcuts_on_file_open", 2);
# XP_WIN
#endif
@ -3989,9 +3997,9 @@ pref("autocomplete.ungrab_during_mode_switch", true);
// toggling to use the XUL filepicker
pref("ui.allow_platform_file_picker", true);
#ifdef MOZ_WIDGET_GTK
// Allow for using the native GTK file picker. If the application is not run
// with GTK_USE_PORTAL=1 this pref has no effect.
#ifdef MOZ_WIDGET_GTK
pref("widget.allow-gtk-native-file-chooser", false);
#endif