Dear people who make websites,

Do you ever block your users from being able to paste into a text field?

Why?

Do you need this ability for a good reason? What’s that reason?

Or, as a user, would you like to see it go away? Perhaps you encounter sites that prevent you from pasting your super complex password from your password manager into a password field, and wonder why they can do so?

What might be the downside of removing support of disallowing pasting from the web?

@jensimmons as a user i hate when sites disable paste

@jensimmons
The only time it has saved me is when a site asked for my password twice. I usually copy and paste it from the first. But this time I'd made a typo. Retyping it helped me validate I'd got it right.

But that's about the only time it has ever been useful for me.

@Edent @jensimmons but if the password manager is generating them for you, you should never need to type them and make a typo...
@ben @Edent @jensimmons
There's a good argument that copy pasting the password is insecure, as many OS let all running apps read the clipboard, and some even keep a clipboard contents history.
@Br3nda @ben @Edent @jensimmons If you’ve copied the password, intending to paste it, then isn’t it already in the clipboard?

@lightandshadow @ben @Edent @jensimmons

Umm.. Yes? Of course? Not sure why you're asking...

@Br3nda @ben @Edent @jensimmons Whether you can paste it or not doesn’t seem to be relevant. It’s already copied to the clipboard, which would make it vulnerable.

I wouldn’t try to copy some random string to see if I could paste it into a password field. I would copy an actual password, then try to paste it. At that point, wound’t it be too late?

@Br3nda FWIW, the modern version of Android only lets the foreground app read the clipboard. And the OS displays a little notification to tell you it has happened.

https://developer.android.com/about/versions/10/privacy/changes#clipboard-data

I don't know about iOS or other OSes though.

Privacy changes in Android 10  |  Android Developers

Android Developers

@Edent

So, changing tab in the browser gives that tab the clipboard?

@Br3nda I don't think so, no.

The OS gives the browser access to the clipboard. You still have to paste in manually.

@Edent I've ways meant to check out what wierd clipboard thing Google docs is doing.
@Br3nda @ben @Edent @jensimmons preventing paste doesn’t prevent anyone from copying the password to clipboard. So blocking paste doesn’t make anyone more secure

@jasonkarns @ben @Edent @jensimmons

yeah it does prevent you copying it there every day.

It's not a good argument to disable paste, for sure.

But the model of copying passwords isn't a good idea.

@Br3nda @ben @Edent @jensimmons there’s an argument, yes. It isn’t a good argument at all.

Because that argument is basically “we’re going to break accessibility and standard conventions for security” and it doesn’t even actually make anything more secure. Any malware that can monitor the pasteboard can also monitor the form field and keyboard input, so you’ve gained nothing.

It is 100% bullshit security theater.

@Br3nda @ben @Edent @jensimmons

This is only true, aiui, for Windows.

In *nix OS, everything runs as a specific user. While I am logged in, apps I start up run as me, and only apps running as me have a chance to see my clipboard.

On Linux OSes using Wayland, there is a further wrinkle: the compositor is the only thing which can read from my clipboard,

So for something malicious to happen it has to

a. already be in the OS,
b. be running as me,
c. and be recognized by the compositor.

1/

@Br3nda @ben @Edent @jensimmons

But another thing to keep in mind is: for passwords, you do not need to use the clipboard.

With #KeepassXC's browser extension, you can have it type the password. I am sure other password database systems have similar features.

2/2 fin

I think for javascript generated content the browser extensions don't always catch the input fields (my experience with bitwarden) @amgine @Br3nda @ben @Edent @jensimmons

@dozymoe @amgine @ben @Edent @jensimmons

Also getting it set up means trusting it as a browser extension or phone keyboard or whatever other mechanism it uses.

@Br3nda @dozymoe @ben @Edent @jensimmons

Indeed. But it is signed by a multi-person encrypted key, and the browser will not allow it to run if it does not match every certificate.

I do not know enough about how it operates to be sure, but I do not believe it runs as a keyboard on a phone. I think it runs entirely within the browser.

More importantly, it is made by people whose project and passion is to secure passwords.. I expect they are under greater targeted scrutiny than average.

@amgine @dozymoe @ben @Edent @jensimmons oh agreeed. Not sure how the average non tech person navigates all this.

@Br3nda @dozymoe @ben @Edent @jensimmons

😄 I think the average non-tech person does exactly what you are doing! approach it very cynically, with lots of caution, asks the tough questions and demands answers.

I wouldn't be too sure, there was Lastpass breach @amgine @Br3nda

@dozymoe @Br3nda

EXACTLY‼️

Keepass is on your machine, not someone else's. When you are a website trusted by tens of thousands of people with their most-trusted passwords and certificates, you are a Big Important Target because all someone has to do is get lucky once for a big payout.

But when everyone has their passwords on their own machines distributed all over the world, the bad guys have to get lucky tens of thousands of times. And no one of them is likely to be super valuable.

@Br3nda @dozymoe @amgine @ben @Edent @jensimmons if we're not trusting the keyboard, blocking pasting becomes kind of irrelevant, no?
@amgine @Br3nda @ben @Edent @jensimmons also password managers can use mime type x-kde-passwordManagerHint to make clipboard managers that respect that not save the password to history

@Edent @jensimmons

I recall in the first hours after the Christchurch quake I was working in an emergency response helpline and trying to copy paste official info to someone and the government website would pop up "image stealing is not allowed" anytime I right clicked.

@Edent @jensimmons But that would also prevent copy-pasting both from a password manager

@DaanWilmer @jensimmons

Most people don't use a password manager.

And, at the time, mine didn't let me autogenerate a new email address per site.

For normal users who only use one email address, it is *probably* sensible to help them make sure they've typed their email addresses in correctly.
Preventing paste isn't ideal - but I bet it stops a large number of user errors.

@Edent @DaanWilmer @jensimmons Normal people only have one email address? I thought it was normal to have many.
@ang6666 @Edent @DaanWilmer @jensimmons blows my mind. Why wouldn’t you have at least two for junk mail??? I’ve got many.

@jensimmons I've seen it a few times as a user (Not recently, but 5 - 10 years ago) on high value sites (I.e., banking).

I've never actually heard from anyone who implements this, why they do so. I assume it's a misguided notion of protecting the end user.

Absolutely not a fan.

@jensimmons
One of the most annoying restrictions. Closely followed by incorrectly set fields so that Safari does not offer autofill.

@jensimmons My old school's SSO page blocked pasting in password fields, which is a big reason why I started using 1Password since it mimics typing. It didn't make anyone more secure, it just punished strong passwords.

I am now out of school but I will die holding this grudge for making me type a 20 character random string every time I wanted to check my email.

@jensimmons Please help make this go away. The blocking of pasting in a password field drives me nuts.

@jensimmons I've seen people do this on confirmation fields. E.g., enter your account number a second time to make sure you didn't mistype it the first time. They want to prevent paste to prevent anyone from propagating a typo in the first field.

I suspect that, in reality, a user that's sophisticated enough to copy-and-paste is sophisticated enough to be pasting the value from the source of truth anyway.

@jensimmons it’s almost always the username and/or password field on login screens, and the whole argument that it’s for better security is bosh. It prevents users from effectively using password managers.
@jensimmons the only case I’ve found that I don’t hate is a delete confirmation where you type something to prove you’re paying attention, and only then when it’s something short like “DELETE”
@jensimmons and even for this use case there are better UI alternatives (though they take more time and care to build)
@jensimmons As a user, I find this UX incredibly hostile. As someone who uses a password management tool, I create & maintain my passwords elsewhere and when I need to manually type a random 20+ character password rather than pasting it in, it's incredibly frustrating, especially on mobile where special symbols are harder to find. And of course the fields are masked as well, so double frustrating.
@jensimmons As a user, I would LOVE to see that "feature" go away.
@jensimmons I would love to see it go away as a user.

@jensimmons Oh, please, I would absolutely LOVE it if that got removed. And while you're at it, please also remove the ability to meddle with copying selected text.

The user locally selects text, and the developer should not be allowed to change what ends up on the clipboard without the user's consent.

@jensimmons disabling copy/paste in a data entry form is the actual worst.
@jensimmons As a web developer, no I don't ever do that. As a user it's very frustrating when you can't paste in a password field.
@jensimmons I've encountered websites that prevent selecting and copying text 😮‍💨
@nrk9819 @jensimmons on Mac, there's this little app called textsniper that "screenshots" text and OCRs it into your clipboard and it's so useful and a giant fuckyou to websites that have that.

@jensimmons To broaden this discussion and give you feedback you didn't ask for ...

I sometimes wonder if we should have a 'Turn off JavaScript' option in the context menu - possibly even suppressing event handlers on a per-element basis.

That would be very useful in a lot of circumstances, including this one.

@ppk @jensimmons

That used to be a feature on the developer menus of several browsers. Although safari's used to switch it of for every window which occasionally had side effects.
I'm not sure why but it went away a few years ago.
Now you have to get plugins to do the same.

@jensimmons I'd love it if sites would stop doing this, but I don't see how the web as a platform could prevent it, short of removing the possibility to have *any* custom behaviour on paste? which might be a bit more controversial possibly
@jensimmons It used to be somewhat useful before password managers to prevent typos. For years now it doesn't seem to make sense disabling pasting though, I never type passwords by hand anymore.
@jensimmons I don't ever do that and neither does my team, but I have understood the use case to be when you want someone to confirm their email or password or whatever (whereas they could just copy and paste one with a typo). I think it's mad annoying, tho, which is why I never build forms with that "feature" in them

All I can think of is bots using harvested credentials.

But that wouldn't be a real user agent.

In general, for human users, disallowing paste/password managers is an anti-pattern, and #WCAG 2.2 gives you a very credible #a11y post to nail this to.

@jensimmons

@jensimmons I hate it when paste is disabled. I also hate it when I have to type username, hit enter, then password on a second screen (very rarely doable with a PW manager)
@jensimmons Just realized it perceived “copy” as “paste”. Yes, I hate disabled copying also, perhaps even more so

@jensimmons I have never, at any point, encountered a scenario where disabling pasting helped me in any way. I always resent it.

I'd go so far as to say that I don't think JavaScript should be allowed to influence the clipboard at all if it weren't for the fact that some code-generating sites have a "copy source" button that's convenient. Like 90% of the times that a site I use does anything with copying/pasting, it's abused.