-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Ensure password inputs are always masked #78
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something we'd want to upstream? If so it should probably an option, though we could start an issue since 2.0 would be a good place to make that breaking change.
The password -> text is a good candidate to upstream though 👍
// Change type to text (simulate "show password") | ||
await page.click('#show-password'); | ||
await page.type('#password', 'XY'); | ||
await page.click('#show-password'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This toggles it back to type: password
? It might be better to test leaving it as text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We test before this line (on 512) that it works while being a text field, so I think this should be OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for addressing this!
Yeah, I think the type change stuff makes sense to upstream. Not sure if they would like to have the "do not allow to opt-out of password" stuff upstream, but I guess I can also just ask! |
Added upstream PR: rrweb-io#1170 |
This PR does two things:
type="password"
inputstype=password
and have this type changed (so e.g. through a "show password" toggle) always keep the password masked, even afterwards.We should never record passwords, and e.g.
toggle password
type buttons are quite common and would easily leak the password into the replay as of now.We do this by adding a
rr_is_password
attribute to the HTML input when the type is changed frompassword
to something else. This is IMHO the easiest solution for this, and since we only add this when the type is really changed (so not eagerly for all inputs) IMHO it's an acceptable tradeoff to have this in the DOM.Closes #34