hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.52k stars 439 forks source link

Command "Ignore *"Password"* window" doesn't work #2771

Open elbowz opened 1 month ago

elbowz commented 1 month ago

Describe the bug The password copied from KeeWeb (password manager) are still saved in the copyq history

To Reproduce Steps to reproduce the behavior:

  1. Enable the command by F6 shortcut
  2. Set the correct window title
  3. Copy something on the password manger (eg. KeeWeb)

Expected behavior The copied text shouldn't appear in CopyQ

Screenshots

Version, OS and Environment

% copyq version
CopyQ Clipboard Manager 9.0.0
Qt: 5.15.14
KNotifications: 5.116.0
Compiler: GCC
Arch: x86_64-little_endian-lp64
OS: Arch Linux
Operating System: Arch Linux 
KDE Plasma Version: 6.1.2
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.8-arch1-1 (64-bit)
Graphics Platform: Wayland

Additional context The command source:

[Command]
Automatic=true
Command="
    copyq ignore"
Icon=\xf069
Name=Ignore *\"KeeWeb|Password\"* window
Remove=true
Window=KeeWeb|Password

CopyQ log: https://pastebin.com/T2PYENcZ

FYI: if I start CopyQ with "env QT_QPA_PLATFORM=xcb copyq", it stops to record the text copied, it only store the last one before open copyq (if you need I can record a screencast for you)

Thanks

hluk commented 1 month ago

Unfortunately, the Wayland version of the app does not support getting window title. See also: https://copyq.readthedocs.io/en/latest/known-issues.html#known-issue-wayland

CopyQ now ignores secrets copied from password managers and other apps out of the box. The problem is that some apps do not indicate properly that clipboard contains a secret/password.

Can you check what formats are listed in the clipboard after you copy something from KeeWeb? You can inspect the formats by selecting File - Show Clipboard Content from menu bar in CopyQ (Ctrl+Shift+C).

elbowz commented 1 month ago

Unfortunately, the Wayland version of the app does not support getting window title. See also: https://copyq.readthedocs.io/en/latest/known-issues.html#known-issue-wayland

I don't read anything about window title on that page. I have try also install the suggested CopyQ command/script Wayland Support without luck.

Before CopyQ worked by forcing it to run on X11 (ie env QT_QPA_PLATFORM=xcb copyq), but It doesn't work anymore. It doesn't save the clipboard history.

Can you check what formats are listed in the clipboard after you copy something from KeeWeb? You can inspect the formats by selecting File - Show Clipboard Content from menu bar in CopyQ (Ctrl+Shift+C).

Screenshot_20240712_125838

I don't think there is any way to tell that the text copied from KeeWeb is a password, is there?

Thanks for your quick reply and help!

hluk commented 1 month ago

I don't read anything about window title on that page. I have try also install the suggested CopyQ command/script Wayland Support without luck.

Ah, I think I only mentioned it in the initial issue (https://github.com/hluk/CopyQ/issues/27). I will add the info.

The command currently only adds support for getting window titles in Sway and Hyprland compositors.

Before CopyQ worked by forcing it to run on X11 (ie env QT_QPA_PLATFORM=xcb copyq), but It doesn't work anymore. It doesn't save the clipboard history.

That's bad, I guess it depends on the Wayland compositor and desktop environment.

I don't think there is any way to tell that the text copied from KeeWeb is a password, is there?

Yeah, unfortunately, I don't see any formats that would indicate a secret.

BTW, you can try using Ignore Passwords/Tokens command which is detecting potential passwords/tokens in the copied text - but it sometimes matches other non-password things.

elbowz commented 1 month ago

BTW, you can try using Ignore Passwords/Tokens command which is detecting potential passwords/tokens in the copied text - but it sometimes matches other non-password things.

Nice, can be useful. At least, it's better to have false positive (ie. password detected and not saved) than false negative.

Thanks for your help! :)

elbowz commented 1 month ago

Excuse me, I would like to open a feature request for KeeWeb, about this password format. Could you provide some information on what kind of format should be provided?

I found something about application/x-kde-passwordManagerHint mime type, but It seems specific for kde. What mime type does copyq need...thanks!

hluk commented 1 month ago

Could you provide some information on what kind of format should be provided?

This is how CopyQ knows that the clipboard is not meant to be stored or further processed: