Bug 162821 - steals the PRIMARY selection when a text search is active (Linux, X11)
Summary: steals the PRIMARY selection when a text search is active (Linux, X11)
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-06 09:38 UTC by Vincent Lefevre
Modified: 2024-11-26 10:25 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lefevre 2024-09-06 09:38:00 UTC
Under Debian / X11 + FVWM, with LibreOffice 24.2.6.2 (this version is not available in the "Version" Bugzilla menu, so I've chosen 24.2.5.2 there):

LibreOffice (Writer, Calc, Draw...) steals the PRIMARY selection when a search is active, just when the mouse happens to move over the LibreOffice window. The PRIMARY selection should be changed only when the user selects something, not by just moving the mouse!

There are possible security implications: if the search text contains private data, and the PRIMARY selection is pasted in a web browser, such private data may be sent to some remote site. Note that the user does not necessarily know that the PRIMARY selection has been stolen. So what he pastes may not be what he thinks.

To reproduce:

1. Start LibreOffice Writer (or Calc, Draw...).
2. Type Ctrl-F to start a search.
3. Type some text to search (a single character is sufficient).
4. Select some text in another application, e.g. xterm.
5. Move the cursor over the LibreOffice window so that this window gets the focus.

Result: The text in the LibreOffice search field automatically gets selected. Moreover it becomes the new PRIMARY selection; this can be seen by pasting the PRIMARY selection somewhere else (with the middle button).

Note that with xterm, xterm unhighlight its selected text when the PRIMARY selection has changed, so it's easier to see the issue.

Bug also reported in the Debian BTS:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1080978
Comment 1 Buovjaga 2024-11-25 17:19:02 UTC
Tested with xterm, KDE Plasma Wayland session and I could not reproduce. The text is selected, but middle-mouse clipboard is not affected.

Have you tested this with other kinds of setups? Does this only happen with X11 + FVWM?
Comment 2 Vincent Lefevre 2024-11-26 09:11:09 UTC
(In reply to Buovjaga from comment #1)
> Have you tested this with other kinds of setups? Does this only happen with
> X11 + FVWM?

I've just tested with X11 + twm (which may be the simplest window manager available), and LibreOffice is also affected.

BTW, this is now libreoffice 4:24.8.3-1 Debian's package.
Comment 3 Vincent Lefevre 2024-11-26 10:12:28 UTC
Same issue with the sawfish window manager. But since with this window manager, the focus does not follow the mouse, I need to click on the LibreOffice window after step 4. Other than that, the behavior is the same.
Comment 4 Vincent Lefevre 2024-11-26 10:25:08 UTC
I suspect that when text is selected under X11, this also automatically puts it in the PRIMARY selection (this is rather logic). So, in such a case, the issue would be that the search text is selected automatically by LibreOffice.

FYI, Firefox had a similar issue in the past:
  https://bugzilla.mozilla.org/show_bug.cgi?id=924069
  https://bugzilla.mozilla.org/show_bug.cgi?id=1165664
where text appearing as selected (but not explicitly selected by the user) was put in the PRIMARY selection.