Open Bug 1897497 Opened 2 years ago Updated 6 months ago

Text entered into the page search field (Cmd + F) is restored after clearing it manually and even after restarting the browser (on macOS)

Categories

(Toolkit :: Find Toolbar, defect)

Firefox 126
ARM64
macOS
defect

Tracking

()

UNCONFIRMED

People

(Reporter: 5silentrain, Unassigned, NeedInfo)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0

Steps to reproduce:

  1. Open any page, for example this one: https://en.wikipedia.org/wiki/Loona
  2. Press the keyboard shortcut Cmd + F to bring up the page search bar
  3. Enter any text in the search bar
  4. Erase the previously entered text with the Delete key and close the search bar by pressing the Esc key or clicking the cross located to the left of the search bar
  5. Press Cmd + F again to bring up the page search bar

Actual results:

Text entered into the page search field (Cmd + F) is constantly restored after manually clearing it with the Delete key and after restarting the browser. This is highly undesirable behavior because I may be entering some sensitive data in this field that should not be recovered after reopening the browser. And yes, this does not happen in Chrome.

I'm using the latest version of macOS Sonoma — 14.5 (23F79).

OS: Unspecified → macOS
Hardware: Unspecified → ARM64

This bug is present in the latest dev version of Firefox — 127.0b3.

The Bugbug bot thinks this bug should belong to the 'Firefox::Search' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Search
Component: Search → Find Toolbar
Product: Firefox → Toolkit

The severity field is not set for this bug.
:enndeakin, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(enndeakin)

I can confirm this issue exists on 128.0ESR. It seems unique to macOS. I cannot repro this on Windows.

This is a serious data sanitization issue. It should be re-categorized as a security/data sanitization bug.

Some quick testing has shown the following:

Data entered into the Find In Page box persists between Firefox sessions. I tried disabling type-ahead find to no avail.

The persistence continues even after clearing all history/data via the settings panel and exiting the browser completely.

Only thing that clears it is a full logout or reboot.

The data is not being pasted from the Clipboard and is being saved in an internal Firefox data store.

In other words, if you do a Cmd-F <super-sensitive-data>, that data will continue to pre-populate the find box until you log out or reboot the device, or until you replace it with another Find In Page search (not in Private Browsing mode). The box will also auto-populate while browsing in Private mode.

Clearing history/website data and/or exiting the browser will not clear the persistence.

I am not sure where this data is being stored.

Also I can confirm this on Intel Mac OS X (submitter tagged it as ARM64).

I think this is just the Mac find pasteboard, most of which the behaviour described above is correct. The only issue is that we should be clearing the find pasteboard when the text in the textbox is deleted.

Flags: needinfo?(enndeakin)

Interesting! I hadn't heard of the Find Pasteboard before, which would explain why the data didn't match the general system clipboard.

Knowing that, there appear to be numerous bugs and inconsistencies in Firefox's behavior, depending on whether or not you are browsing in Private Browsing mode. For comparison I'm evaluating the behavior against that of TextEdit. I'll try to summarize them below:

  1. In normal mode, the Find Pasteboard is not cleared when the textbox is deleted (as you pointed out).

  2. In normal mode, the Find Pasteboard is no longer updated with text from Firefox under the following conditions:
    a. You are typing text and the “Phrase not found” condition is reached during typing
    b. <Enter> is not pushed at the end of the phrase
    c. The string copied to the Find Pasteboard is of Length(String_When_Phrase_Not_Found) + 1
    d. E.g. if a page contains the text ‘abc’ and you type ‘abcdefg’ into the Find Bar, the text copied to the Find Pasteboard is ‘abcd’
    e. Exception: If <Enter> is pushed at the end of the string, despite “Phrase not found”, the entire string is copied to the Find Pasteboard
    f. The same logic applies if using Quick Find ‘/’ or the Cmd-F dialog.

  3. In Private Browsing mode, the system’s Find Pasteboard is never written to, but always read from whenever Cmd-F is pressed (even if the search dialog was already open). This causes really problematic behavior because the search box is always being overwritten with the contents of the system’s Find Pasteboard, even if a previous search was executed in Firefox Private Browsing mode.
    E.g. if the contents of the Find Pasteboard is ‘abcd’ and you are searching a page for ‘efgh’ and perform either of the following:
    a. Press Cmd-F when the dialog is open
    b. Close the dialog and press Cmd-F to reopen it to continue searching
    the contents is overwritten with ‘abcd’. Furthermore, executing a quick find ‘/’ in Private mode, that data is not copied to the Cmd-F dialog if it’s reopened (overwritten as described above).

While the behavior in normal mode is easy to remedy, how is it best to handle searches in Private Browsing mode? The most logical to me would be to maintain an internal buffer and never read from or write to the system’s Find Pasteboard.

The severity field is not set for this bug.
:enndeakin, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(enndeakin)

While the behavior in normal mode is easy to remedy…

Please fix this problem at least in normal mode 🙏

Happy two year anniversary to this bug! Maybe we can get a severity assigned before my hair turns grey.

This affects both Intel and ARM64.

You need to log in before you can comment on or make changes to this bug.