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

SVG data-URI images are removed #148

Closed
jampy opened this issue Apr 13, 2016 · 3 comments
Closed

SVG data-URI images are removed #148

jampy opened this issue Apr 13, 2016 · 3 comments

Comments

@jampy
Copy link

jampy commented Apr 13, 2016

DOMpurify strips the data-uri from the this tag:

<feImage xlink:href="data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100px%22%20height%3D%22200px%22%20%20%3E%0A%09%3Cdefs%3E%0A%09%09%3Cpattern%20id%3D%22pattern%22%20patternUnits%3D%22userSpaceOnUse%22%20width%3D%225px%22%20height%3D%225px%22%20viewBox%3D%220%200%205%205%22%20%3E%0A%09%09%09%3Cpolygon%20points%3D%225%2C0%204.012%2C0%205%2C0.989%20%09%22%2F%3E%0A%09%09%09%3Cpolygon%20points%3D%225%2C5%200%2C0%200%2C0.989%204.01%2C5%20%09%22%2F%3E%0A%09%09%3C%2Fpattern%3E%0A%09%3C%2Fdefs%3E%0A%09%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%23pattern)%22%20%2F%3E%0A%3C%2Fsvg%3E" x="0" y="2" width="100" height="200" result="STRIPED-SHADOW_10"></feImage>

I tried to...

  • add image to the DATA_URI_TAGS
  • add "href", "xlink:href" to the URI_SAFE_ATTRIBUTES

... but the attribute is still being removed.

Can anybody please explain to me, why?

Also, do you consider it dangerous to allow DATA URIs here?

@cure53
Copy link
Owner

cure53 commented Apr 13, 2016

They caused XSS in Opera, that's why we decided to remove them :)

@cure53
Copy link
Owner

cure53 commented Apr 13, 2016

Can you demonstrate how you tried to add them? It should work if you manually add them the right way - thus we might have a bug here.

@cure53
Copy link
Owner

cure53 commented Apr 18, 2016

ping :)

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

No branches or pull requests

2 participants