Skip to content

Prevent autocomplete on username & password fields#126

Merged
ashwanthkumar merged 1 commit intoashwanthkumar:masterfrom
gavingmiller:master
Sep 7, 2018
Merged

Prevent autocomplete on username & password fields#126
ashwanthkumar merged 1 commit intoashwanthkumar:masterfrom
gavingmiller:master

Conversation

@gavingmiller
Copy link
Contributor

When gocd has authentication enabled, these two fields are auto-populated
with the gocd username and password. As a result credentials can be
submitted that shouldn't be and a user's gocd account inadvertently
compromised.

auto-populated

@ashwanthkumar
Copy link
Owner

I don't have much experience on working with HTML across browsers. I was just googling about this change, and found the following resources

These sites suggest against using autocomplete="off". Do you've some inputs? Forgive me if I've misunderstood something.

@gavingmiller
Copy link
Contributor Author

😢 looks like autocomplete="new-password" is a potentially solution. I'll give that a try and update the PR if it works.

When gocd has authentication enabled, these two fields are auto-populated
with the gocd username and password. As a result credentials can be
submitted that shouldn't be and a user's gocd account inadvertently
compromised.

Use the solution as outlined here:
https://stackoverflow.com/a/30976223/33226
@gavingmiller
Copy link
Contributor Author

@ashwanthkumar I've updated the pull request with the suggested solution from https://stackoverflow.com/a/30976223/33226. I'll test locally with my users tomorrow and let you know if it's successful or not. The solution only works for Chrome & not Firefox unfortunately.

@gavingmiller
Copy link
Contributor Author

gavingmiller commented Sep 7, 2018

Tested & confirmed that autocomplete=new-password will not autofill username & password (in Chrome.)

@ashwanthkumar
Copy link
Owner

👍 Thank you @gavingmiller

@ashwanthkumar ashwanthkumar merged commit 071723d into ashwanthkumar:master Sep 7, 2018
@ashwanthkumar
Copy link
Owner

I'll cut a release with these changes soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants