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

img attribute getting removed #14

Open
snap9 opened this issue Feb 2, 2017 · 2 comments · May be fixed by #15
Open

img attribute getting removed #14

snap9 opened this issue Feb 2, 2017 · 2 comments · May be fixed by #15

Comments

@snap9
Copy link

snap9 commented Feb 2, 2017

I'm using imgsrc to support high-resolution display images: https://webkit.org/demos/srcset/

<img src="image.jpg" srcset="image-1x.jpg 1x, image-2x.jpg 2x, image-3x.jpg 3x">

Your XSS strips this down to

<img src="image.jpg">

It just gets rid of the srcset. Why, and if srcset isn't really dangerous, can you consider whitelisting it?

@gregwebs
Copy link
Member

This is easy to add: I pushed a srcset branch.

However, this attribute is not in my reference implementation: https://github.com/html5lib/html5lib-python/blob/master/html5lib/filters/sanitizer.py
A goal of this library is to have 3rd-party vetting of the safety of the sanitization.

@gregwebs
Copy link
Member

ok, that implementation is stalled. srcset looks like it can be treated just like src

@gregwebs gregwebs linked a pull request Apr 10, 2017 that will close this issue
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 a pull request may close this issue.

2 participants