keepassxc icon indicating copy to clipboard operation
keepassxc copied to clipboard

[WIP] Clear clipboard instead of doing nothing when no value is present to copy

Open Copilot opened this issue 8 months ago • 0 comments

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Have you searched for an existing feature request?

  • [x] Yes, I tried searching

Brief Summary

When pressing Ctrl/Cmd + T to copy a TOTP, and none is configured, nothing is copied to the clipboard.

While this totally makes sense, since it is technically a user error, it can lead to unintended behavior: the previously copied value (often a password) may be pasted into the TOTP field. If that field is not masked, this could result in credentials being exposed on screen or inadvertently processed.

Would it not be more secure to either clear the clipboard or place a placeholder (e.g., a warning message) on it in such cases?

Example

In a entry without TOTP configured, the user presses Ctrl/Cmd + T expecting to copy a code. Since none exists, the previous clipboard content (e.g., a password) is pasted into the TOTP field instead.

Context

Keyboard shortcuts are used heavily for efficiency, and it is not always noticed when no code is copied.

Fixes #12184.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot avatar Jun 15 '25 17:06 Copilot