Closed Bug 1696974 Opened 4 years ago Closed 1 year ago

Middle-clicking to close a tab can cause the selection to be pasted in the URL bar

Categories

(Firefox :: Tabbed Browser, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1701638

People

(Reporter: nika, Unassigned)

Details

Attachments

(1 file)

Attached video STR Recording

On linux, when middle-clicking on a tab to close the tab, if the next tab which will be focused is about:newtab, the current selection will be pasted into the URL bar of the new about:newtab tab.

I think this is caused by focus being moved into the URL bar of the switched-to tab before the paste event is resolved from the middle-mouse-click.

STR:

  1. On linux, open the browser, and open 2 tabs.
  2. Select some text in the content body, putting it onto the selection clipboard.
  3. middle-click on the focused about:newtab tab, and the text will appear in the URL-bar of the unfocused about:newtab tab.

I've attached a short video of me reproducing the issue

Yeah same problem here.

With a clean profile, middle-clicking anywhere around control elements will leak contents of the clipboard into the URL bar. In my case short text data in the clipboard may not paste, but the formatted data (selected table, image + text) will paste everytime.

Problem occured immediately after update to firefox 87.0, previous version seemed to be fine. OS is slackware-current.

Hitting same bug when middle clicking new tab button, also new, also on Linux, with (the default) middle click paste enabled etc.

Chiming in to say that:

  • Other than the toolbar it happened once with the search bar, pressing ctrl+F pasted something random I selected some time ago, in a different app, instead of the usual default (selection in current tab or recent search).
  • It's intermittent.
  • Once triggered it's reliable until I interact with something else. In this state clicking any toolbar button that doesn't have a specific middle click action (like the firefox account icon), and some buttons that do (like 'new tab' but not ublock's button) will will reliably paste last selected text into the address bar.
  • Selecting some other text will clear it on second or third try.
  • Immediately after that playing with text selection and new tab button will reenter the borked state in <10 tries. But an hour later I couldn't get it to trigger.

Using Firefox 88.0 on Win10, have reproduced the misbehaviors where:

  • Middle-click on the empty tab bar to open a new tab also pastes the clipboard content into the new tab's urlbar; or...
  • M-click on a tab to close it also pastes the clipboard into the urlbar of next tab to appear (or current tab if closed tab was in background), if that tab was last left with focus in the urlbar.

However, apparently this only occurs if the clipboard content contains a newline char in any position; even a single char prefixed or suffixed with a newline in clipboard will suffice, copied from any app.

I think this bug was fixed at some point between Firefox 87 and 92. I got it on both KDE and Xfce, and it no longer occurs on my KDE machine, and was fixed on my Xfce live USB stick by upgrading from 87 to 92.

Confirmed, the misbehaviors I described above now no longer occur in v92 on Win10.

Yes, can confirm I see this fixed on 91.0.2.

I'm not sure if that's same issue but when I open links from bookmark bar using middle click, content from clipboard also leaks to url bar.

Given that search bar sends information to search engine Firefox might easily send private information where you don't want to. That's pretty bad.

(In reply to gudvinr from comment #7)

I'm not sure if that's same issue but when I open links from bookmark bar using middle click, content from clipboard also leaks to url bar.

Given that search bar sends information to search engine Firefox might easily send private information where you don't want to. That's pretty bad.

I can reproduce this with Firefox 114.0.1 on Linux.

It appears to happen when there are content in the X Primary Selection buffer, and the content contains newline character.

Steps to reproduce:

  1. Select some text including newline character, to put them into the X Primary Selection buffer. The xclip utility can be used to demonstrate the issue:
    echo -e "xyz\n" | xclip -r

  2. In Firefox, open a New Tab. Let the focus stay in the address bar.

  3. Middle-click on a bookmark (to open it in a new tab)

Expected result:

  • The bookmark to open in a new tab.
  • No change in the "New Tab" tab.

Actual result:

  • The bookmark opened in a new tab.
  • In the "New Tab" tab, "xyz " is pasted into the address bar.

I also agree that it could become a privacy issue if search engine suggestion is enabled.

Update: just noticed that this issue appears to be fixed already so I filed a new bug report: bug 1838743

(In reply to wacheo from comment #8)

I also agree that it could become a privacy issue if search engine suggestion is enabled.

Middle-mouse paste should be disabled if you are concerned by clipboard privacy since it is inherently leaky (Bug 1515783). This can be done by going to about:config and changing middlemouse.paste to false.

Fix window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=65dc61a78542a0521d4c9a42ff7bd152a88029fc&tochange=b85e871f6a8d57cdc744634dadb2b0af88422504

Fixed by Bug 1701638.

Status: NEW → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1701638
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: