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

Some new css attributes are not referenced in the list and end up being removed from the sanitized string. like align-items. #197

Closed
miguelperez opened this issue Nov 24, 2020 · 2 comments

Comments

@miguelperez
Copy link

miguelperez commented Nov 24, 2020

Flex properties like align-items are removed from the sanitized css.

ACCEPTABLE_CSS_PROPERTIES = Set.new([

Is there a particular reason security those are not included? or Should I add a PR with the missing attributes? @flavorjones

UPDATE:
for reference, this is a complete list of CSS Properties: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference

@flavorjones
Copy link
Owner

Hi @miguelperez yes, please submit a PR with any additional CSS properties that you think should be included. This list was snapshot in 2008 in commit c673657 taken from http://code.google.com/p/html5lib/ and we've been adding more properties as the spec has evolved and as people needed it.

There is some half-finished work to port Loofah to use DOMPurify and its CSS properties safelist -- see #155. Rather than generating and keeping our own list, the end game is to use DOMPurify's list, because it's widely-used and well-maintained.

Hope this helps!

@flavorjones
Copy link
Owner

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