2
votes

I have seen a few threads explaining that Flash can be used to set the clipboard data in Mozilla and Internet Explorer, it's easy, etc.

For example Greasemonkey\JavaScript Copy to Clipboard button

However, I would like to read the clipboard and remove certain items before setting it. Is there any way to do this?

So.. Is it possible then to detect whether copying and pasting is occuring? Then redirect them to another URL?

1
Consider the scenario where the user just copied their login password to some secure service into their clipboard and then they haplessly visit a malicious site that uses JavaScript to harvest their clipboard and an AJAX request to send it off to the server. Major security risk. - Nathan Taylor
i guess it is a security issue for someone who copies and pastes their password, but im not after this info. My question is can it be done? - Ke.
Is it possible then to detect whether copying and pasting is occuring? Then redirect them to another URL? - Ke.
However you do this, be sure that you don't wipe the user's clipboard without permission. Provide a Copy/Paste button that calls your action. e.g. GitHub has a little copy button for the read-only url that uses a hidden flash component. - scunliffe
If you're afraid of someone stealing the content by copying a url of some sort, maybe you shouldn't put it on the internet to begin with. - Alex Sexton

1 Answers

5
votes

Reading the clipboard is a pretty big security issue. Even if you can do it, it's not considered a friendly tactic, and I would advise against it, especially if you plan on changing it.