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

Sanitize css properties of style attributes #1

Merged
merged 1 commit into from
Aug 10, 2017

Conversation

gerad
Copy link

@gerad gerad commented Aug 9, 2017

@gerad gerad requested a review from gdehmlow August 9, 2017 19:06
},
{
in: `<div style="text-align;background: javascript:alert('xss')">no xss</div>`,
expected: `<div style="">no xss</div>`,
Copy link

Choose a reason for hiding this comment

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

Do we maybe just want to remove the style attribute if it's an empty string? i don't think it particularly matters but

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, there's a different option that should remove it… but it doesn't seem to work: https://github.com/sagansystems/bluemonday/blob/master/policy.go#L154

Copy link
Author

Choose a reason for hiding this comment

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

I didn't want to try and fix the bug in this PR. When I was searching through the code, it looked like it was just globally broken, not broken by this PR.

@gdehmlow
Copy link

gdehmlow commented Aug 9, 2017

Looks good to me

@gerad gerad merged commit 9a706f0 into master Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants