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

Allow data & mxc URLs in img tags in HTML #2900

Closed
ara4n opened this issue Jan 8, 2017 · 3 comments
Closed

Allow data & mxc URLs in img tags in HTML #2900

ara4n opened this issue Jan 8, 2017 · 3 comments

Comments

@ara4n
Copy link
Member

ara4n commented Jan 8, 2017

PR matrix-org/matrix-react-sdk#333 whitelisted data URIs for img tags in the HTML sanitizer. Unfortunately this introduced a vuln where you could do <img src=//evil.com/tracker.gif/> given null URL schemes are apparently implicitly in the allowedSchemes list, and got backed out in matrix-org/matrix-react-sdk@8ae210c. Would be good to get it back again, especially so we can embed mxc URLs nicely in messages for stickers, custom emoji, captioned images, etc.

@lukebarnard1
Copy link
Contributor

I've pushed apostrophecms/sanitize-html#137 but not sure if it'll get through - activity on that project seems minimal.

We could roll our own version of naughtyHref which would not be that painful. That would mean removing all the hrefs that don't validate.

@lukebarnard1
Copy link
Contributor

lukebarnard1 commented Jan 13, 2017

FTR apostrophecms/sanitize-html#137 got merged (and published to npm), so we should be able to whitelist data: and mxc: if we want 😁

@ara4n
Copy link
Member Author

ara4n commented Feb 19, 2017

done in matrix-org/matrix-react-sdk#712

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