PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Advanced Paste automatically paste into slack chat on focus

Open brainfoolong opened this issue 1 year ago • 14 comments

Microsoft PowerToys version

0.81.0

Installation method

PowerToys auto-update

Running as admin

None

Area(s) with issue?

Advanced Paste

Steps to reproduce

I attach a video the shows the behaviour. On Windows, when i have closed slack into systray and then open a chat window, all clipboard data is automatically inserted into slack. Even files i have copied in file explorer.

This does not happen when i just minimize to task bar instead of systray.

I do not press any key. Just open with a click on the systray icon.

The only plugin i have activated is Advanced Paste (Screenshot bellow). If i disable just this plugin or close power toys, the auto insert is gone.

This started immediately after todays update to 0.81.0.

This behaviour can lead to serious data breach if you do not pay attention.

powertoys.webm

image

✔️ Expected Behavior

No auto insert in any application.

❌ Actual Behavior

Auto insert with just focusing a window....

Other Software

Slack

Report

PowerToysReport_2024-05-22-13-13-02.zip

brainfoolong avatar May 22 '24 10:05 brainfoolong

Hi, could you attach /bugreport? Thank you

stefansjfw avatar May 22 '24 11:05 stefansjfw

Does this happen with slack only? Or with other apps as well? Could you try e.g. notepad?

stefansjfw avatar May 22 '24 11:05 stefansjfw

Report added to original post.

No, as of now i only can see this in Slack. Signal, Notepad and office works fine, as far as i can see.

brainfoolong avatar May 22 '24 11:05 brainfoolong

I have debugged further and indeed, PowerToys make my system sending 1 special keystrokes when this plugin is enabled. I do not press any key (later i do CTRL+A and delete to remove pasted text), but when i use screenrecorder to record also system keystrokes, is see 1 'CTRL+V' automagically, when i just click the systray of slack. When i disable the powertoys plugin, no keystroke is sending anymore.

See new video.

powertoys-2.webm

brainfoolong avatar May 22 '24 12:05 brainfoolong

We've debugged and it's that when there's no key set for Paste as Markdown or JSON we're actually catching the "none" shortcut. When you press Slack's tray icon, it sends the "None" shortcut. @stefansjfw is working on a fix

jaimecbernardo avatar May 22 '24 12:05 jaimecbernardo

I have the same exact issue. Seems like that does not affect other applications that can be opened from systray (like discord or spotify)

kuleshov-aleksei avatar May 22 '24 12:05 kuleshov-aleksei

Very good catch. PR opened with the fix

stefansjfw avatar May 22 '24 12:05 stefansjfw

As a workaround for the time being, you can set a shortcut for "Paste as Markdown" and "Paste as JSON" and it should no longer exhibit this behavior.

jaimecbernardo avatar May 22 '24 18:05 jaimecbernardo

Validating that I have this issue and that setting a shortcut for "Paste as Markdown" seems to have solved it.

Will see if I now start getting JSON pastes until I set that as well or if I only had that issue with markdown. Edit: No surprise, I did. Had to fill that hotkey too.

Also curious, though out of scope: what is slack doing to trigger this?

MitchSchwartz avatar May 22 '24 19:05 MitchSchwartz

I'm having this problem when I try to rearrange my opened tabs on Windows Terminal (drag one of my tabs from one place to another)! When I do this, a bunch of texts are paste in the dragged terminal!

Thanks.

Dominiquini avatar May 24 '24 03:05 Dominiquini

Also curious, though out of scope: what is slack doing to trigger this?

@MitchSchwartz Left-clicking Slack systray icon sends None keyboard key. As these hotkeys were not set, and all modifier keys are not pressed this matched our not-set hotkey default state.

@Dominiquini Does setting To Markdown and To JSON hotkeys make the problem go away for you ?

stefansjfw avatar May 24 '24 09:05 stefansjfw

Also curious, though out of scope: what is slack doing to trigger this?

@MitchSchwartz Left-clicking Slack systray icon sends None keyboard key. As these hotkeys were not set, and all modifier keys are not pressed this matched our not-set hotkey default state.

@Dominiquini Does setting To Markdown and To JSON hotkeys make the problem go away for you ? Yes, this solve the problem. Thanks!

Dominiquini avatar May 24 '24 23:05 Dominiquini

I'm gonna chime in here with https://github.com/microsoft/terminal/issues/17324 as well. Looks like dragging a Terminal tab with Advanced Paste enabled will also repro similar behavior.

zadjii-msft avatar May 28 '24 11:05 zadjii-msft

So this is why I keep finding weird stuff pasted into Slack!

DHowett avatar May 28 '24 16:05 DHowett

Wonder how many unsolicited pr0n links and sensitive credentials have been submitted accidentally by this bug :]

fritzmg avatar May 28 '24 16:05 fritzmg

The Slack issue is slightly annoying, but the Terminal problem (where it repeatedly pastes as you drag around) is potentially more serious if you have a multiline command in your clipboard. Imagine copying a command to delete the most recent row from a db table. Drag the tab around and a whole boatload of rows are gone! Really surprised they haven't pushed out a hotfix to this yet!

vitaminj avatar May 28 '24 16:05 vitaminj

The Slack issue is slightly annoying, but the Terminal problem (where it repeatedly pastes as you drag around) is potentially more serious if you have a multiline command in your clipboard. Imagine copying a command to delete the most recent row from a db table. Drag the tab around and a whole boatload of rows are gone! Really surprised they haven't pushed out a hotfix to this yet!

@vitaminj Version v0.81.1 Is now out with the fix.

epikkoder avatar May 28 '24 17:05 epikkoder

Thank you for fixing this - was driving me crazy the past week - but was happening for me with Clarion based software, each time I opened it or triggered a new window to open - just fyi

ThaDaVos avatar Jun 07 '24 14:06 ThaDaVos

Wonder how many unsolicited pr0n links and sensitive credentials have been submitted accidentally by this bug :]

Passwords would be my concern. Lots of people use password managers, and they often use the clipboard to paste passwords into text fields...

nabeelr avatar Jun 13 '24 03:06 nabeelr

Microsoft PowerToys version

0.81.0

Installation method

PowerToys auto-update

Running as admin

None

Area(s) with issue?

Advanced Paste

Steps to reproduce

I attach a video the shows the behaviour. On Windows, when i have closed slack into systray and then open a chat window, all clipboard data is automatically inserted into slack. Even files i have copied in file explorer.

This does not happen when i just minimize to task bar instead of systray.

I do not press any key. Just open with a click on the systray icon.

The only plugin i have activated is Advanced Paste (Screenshot bellow). If i disable just this plugin or close power toys, the auto insert is gone.

This started immediately after todays update to 0.81.0.

This behaviour can lead to serious data breach if you do not pay attention.

powertoys.webm

image

✔️ Expected Behavior

No auto insert in any application.

❌ Actual Behavior

Auto insert with just focusing a window....

Other Software

Slack

Report

PowerToysReport_2024-05-22-13-13-02.zip

mutebmuhd1403 avatar Aug 04 '24 15:08 mutebmuhd1403