Skip to content
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

Mask value attribute changes for elements in maskInputOptions #602

Merged
merged 8 commits into from
Jun 30, 2021

Conversation

Juice10
Copy link
Contributor

@Juice10 Juice10 commented Jun 28, 2021

I noticed that some frameworks keep the contents of their form fields in sync with their value attributes.
Since we were not filtering mutations to value attributes for sensitive fields, that means that passwords and other masked information could leak into rrweb events.

This PR masks attribute mutations on value attributes for masked input fields.

@Juice10 Juice10 changed the title Mask value attribute changes for elements in maskInputOptions [draft] Mask value attribute changes for elements in maskInputOptions Jun 28, 2021
@Juice10 Juice10 changed the title [draft] Mask value attribute changes for elements in maskInputOptions Mask value attribute changes for elements in maskInputOptions Jun 28, 2021
src/utils.ts Outdated

// TODO: move me to rrweb-snapshot
// we are doing similar things there as well, would be best to keep things consistent
export function maskInputValue({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to move this code now? I can release a new version of rrweb-snapshot when this gets merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm out of office all day today, earliest I can do this would be about 24 hours from now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can merge this PR and I can follow up with a cleanup PR that moves this to rrweb-snapshot tomorrow?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yuyz0112
Copy link
Member

@Juice10 Let me understand this better.

If someone use React to build an input component and sync the value to DOM attribute:

  1. the replay of input typing will be masked correctly
  2. users can inspect the replayer and get the value from the DOM attribute

Am I right?

@Juice10
Copy link
Contributor Author

Juice10 commented Jun 30, 2021

@Yuyz0112 correct!

Yuyz0112 pushed a commit to rrweb-io/rrweb-snapshot that referenced this pull request Jun 30, 2021
@Yuyz0112
Copy link
Member

@Juice10 Please upgrade to rrweb-snapshot@1.1.6, thanks!

@Yuyz0112
Copy link
Member

LGTM

@Yuyz0112 Yuyz0112 merged commit ed37401 into rrweb-io:master Jun 30, 2021
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