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

FEATURE: Treat site settings as plain text and add a new HTML type. #12618

Merged
merged 1 commit into from Apr 7, 2021

Conversation

romanrizzi
Copy link
Member

To add an extra layer of security, we sanitize settings before shipping them to the client. We don't sanitize those that have the "html" type.

The CookedPostProcessor already uses Loofah for sanitization, so I chose to also use it for this. I added it to our gemfile since we installed it as a transitive dependency.

Copy link
Contributor

@eviltrout eviltrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks quite nice and clean, thank you Roman.

My only concern is that some plugins might be using the previous, non-html settings for HTML. I am not aware of any of these but they will be broken now due to sanitization. They will have to be updated, but honestly that is much safer in the long run.

To add an extra layer of security, we sanitize settings before shipping them to the client. We don't sanitize those that have the "html" type.

The CookedPostProcessor already uses Loofah for sanitization, so I chose to also use it for this. I added it to our gemfile since we installed it as a transitive dependency.
@romanrizzi romanrizzi merged commit 5e4c0e2 into master Apr 7, 2021
@romanrizzi romanrizzi deleted the html_site_setting branch April 7, 2021 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants