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

Risks of whitelisting background-image SafeList::ALLOWED_CSS_PROPERTIES #183

Closed
puneet-sutar opened this issue Feb 12, 2020 · 2 comments
Closed

Comments

@puneet-sutar
Copy link

background-image is not included in SafeList::ALLOWED_CSS_PROPERTIES
I want to enable till to set background-image as a url.
What are potential risk and things I should consider while doing this.
My usecase is while using rails action text.
Thanks for the help.

@flavorjones
Copy link
Owner

Hi @puneet-sutar - attributes that cause loading of external assets via URLs/URIs are sanitized.

Please also note that Loofah doesn't have an opinion here, we're using the attributes from HTML5Lib; and #155 proposes using DomPurify. Both of these packages do not consider background-image to be safe.

I hope this helps?

@puneet-sutar
Copy link
Author

@flavorjones That helps a lot and will help me make further decisions regarding my project.
Thanks a lot.

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