Open Bug 1831879 Opened 1 year ago Updated 3 months ago

The "Save image" and "Download link" context menu items do not have a download confirmation prompt like other browsers, making it possible to leak private tabs by accident

Categories

(Fenix :: Downloads, enhancement)

Firefox 115
All
Android
enhancement

Tracking

(firefox115 affected)

Tracking Status
firefox115 --- affected

People

(Reporter: ke5trel, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome, privacy)

Attachments

(1 file)

STR:

  1. Open a private tab in Android Nightly 114.
  2. Long-press an image to show the context menu and choose "Save image" or "Download link".

The file is immediately saved to disk without any confirmation, compromising the private tab. It's easy to accidentally open the context menu or tap the wrong item while doing regular actions like opening links in a new tab. The "Download link" item appears in the middle of the screen which is likely to be under finger.

A download notification appears but small files download faster than it takes to cancel them, the notification itself may go unnoticed and deleting the files afterwards does not prevent them from being recovered.

Chromium-based browsers show a download confirmation when saving images and hide the "Download link" in private tabs. Many of them show the confirmation in non-private tabs as well (eg Edge, Brave, Opera, Vivaldi, Kiwi and LineageOS).

A work around is to install a download manager and enable the setting for it so that Android asks which app to use, giving an opportunity to cancel the download before it starts. This work around is not available in Firefox Focus and Tor Browser.

Blocks: meta_tor
Severity: -- → N/A
Type: defect → enhancement

A quick fix.

diff --git a/android-components/components/feature/contextmenu/src/main/java/mozilla/components/feature/contextmenu/ContextMenuCandidate.kt b/android-components/components/feature/contextmenu/src/main/java/mozilla/components/feature/contextmenu/ContextMenuCandidate.kt
index 28ad4b510b..b604787c51 100644
--- a/android-components/components/feature/contextmenu/src/main/java/mozilla/components/feature/contextmenu/ContextMenuCandidate.kt
+++ b/android-components/components/feature/contextmenu/src/main/java/mozilla/components/feature/contextmenu/ContextMenuCandidate.kt
@@ -359,7 +359,7 @@ data class ContextMenuCandidate(
             action = { tab, hitResult ->
                 contextMenuUseCases.injectDownload(
                     tab.id,
-                    DownloadState(hitResult.src, skipConfirmation = true, private = tab.content.private),
+                    DownloadState(hitResult.src, skipConfirmation = !tab.content.private, private = tab.content.private),
                 )
             },
         )
@@ -418,7 +418,7 @@ data class ContextMenuCandidate(
             action = { tab, hitResult ->
                 contextMenuUseCases.injectDownload(
                     tab.id,
-                    DownloadState(hitResult.src, skipConfirmation = true, private = tab.content.private),
+                    DownloadState(hitResult.src, skipConfirmation = !tab.content.private, private = tab.content.private),
                 )
             },
         )
@@ -446,7 +446,7 @@ data class ContextMenuCandidate(
             action = { tab, hitResult ->
                 contextMenuUseCases.injectDownload(
                     tab.id,
-                    DownloadState(hitResult.src, skipConfirmation = true, private = tab.content.private),
+                    DownloadState(hitResult.src, skipConfirmation = !tab.content.private, private = tab.content.private),
                 )
             },
         )
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: