21

The new copy-paste budget can be easily be bypassed using a simple JavaScript hack:

localStorage["copyBudget"] = "Infinity";

Now people can copy-paste all they want without The Key™! It should be patched.

18
  • 3
    This is very concerning.
    – Octal
    Commented Apr 1, 2021 at 19:48
  • Also pretty cool...
    – Ollie
    Commented Apr 1, 2021 at 20:08
  • 7
    This is just the first release of our enhanced copying experience. For now, we're just on the honor system - we didn't get quite enough time to implement copy blocking (yet)
    – Kyle Pollard StaffMod
    Commented Apr 1, 2021 at 20:48
  • 7
    Shhh! You're not supposed to post security vulnerabilities to Meta!
    – zcoop98
    Commented Apr 1, 2021 at 20:51
  • @zcoop98 Even if it's a site of developers?
    – Anonymous
    Commented Apr 1, 2021 at 21:05
  • 1
    @Anonymous - given how readily folks click on things around here, this should not be a problem too hard to solve :)
    – 0Valt
    Commented Apr 2, 2021 at 0:53
  • 1
    @Anonymous - "we now have a desktop app - be the first to try out the new cool features" :) Anyways, just joking. P.s. I like how the budget counter gets into negative values the more you copy. Also - doesn't budget get reset to 2 if it is more than that value upon next copy?
    – 0Valt
    Commented Apr 2, 2021 at 2:22
  • 1
    @OlegValter It seems to, but if you put 500, it would show 2 even though it takes 500 copies.
    – Anonymous
    Commented Apr 2, 2021 at 2:23
  • 1
    @Anonymous - yup, just mentioned that Infinity gets reset to 2. Also major props for being line aware as it seems: i.sstatic.net/xR1OB.gif :) P.s. An even more robust version: document.addEventListener("keyup", ({ ctrlKey, key }) => { if(ctrlKey && key.toLowerCase() === "c") { localStorage.copyBudget = "Infinity"; } });
    – 0Valt
    Commented Apr 2, 2021 at 2:37
  • 2
    @OlegValter addEventListener("copy", e=>e.stopImmediatePropagation(), true); would be both more straightforward and more robust, e.g your code wouldn't work on macOs devices where we copy using the metaKey, nor for users copying through other means than a keyboard.
    – Kaiido
    Commented Apr 2, 2021 at 3:02
  • 1
    @Kaiido - yeah, I agree, the copy event is even better, didn't think too much about the upgrade :)
    – 0Valt
    Commented Apr 2, 2021 at 3:09
  • 1
    Wow, nine upvotes! I thought this would get closed as off-topic.
    – Anonymous
    Commented Apr 2, 2021 at 13:12
  • 2
    Based on this answer, it is called "vulnerability" rather than bug. Commented Apr 2, 2021 at 22:01
  • 2
    @Thor-x86_128 - let's go further and specify that this is an "exploit" :)
    – 0Valt
    Commented Apr 3, 2021 at 1:37
  • 1
    I've heard rumours that user don't vote nor review enough on Stack. Perhaps we should get an option to "buy" copy-rights. One vote gets one copy and one review gives two. Then there's be no need to steal copy-rights by hacking ;)
    – Scratte
    Commented Apr 3, 2021 at 20:34

0

Browse other questions tagged .