-
Notifications
You must be signed in to change notification settings - Fork 18
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
Nested scripts #9
Comments
Please see discussion on the referenced github issue. |
Hi. I'm sorry to be coming back one year later. I just saw a similar issue to the one reported on a server I've worked at. Here's the use case to make myself as clear as I can. I have a Profile model that has a description. On this description I allow special characters for various things: For example We are using a rich text renderer that is susceptible to xss, but has too many nice features to avoid, so our compromise was using
This opens up to the vulnerability, originally described in flavorjones/loofah#127 When the user sets the description to:
The output from loofah (with encode special chars false) is
Because our renderer is susceptible to XSS, this is a huge problem I agree with you on the original topic that our use case is an 'edge case However, for the purposes of Let me know if it is at all possible to sort this out on the Thank you for your time. |
@myxoh Thanks for bringing this up. I think you're still confusing text strings with HTML strings.
As I explained at length in flavorjones/loofah#127, when you ask Loofah to leave If you 1) ask for I strongly suggest that you simply look into using use Rails's I hope this response helps. |
This related to the issue: flavorjones/loofah#127
When storing in a database it's more common not to store the characters encoded, making the nested script issue more of an issue than in the base library. I've already submitted a fix to Loofah that adds the new method
recursive_scrub_fragment
, I suggest xss_foliate use this scrub instead of the base scrub, I will start working on a PR as soon as the recursive scrubbing is merged into LoofahThe text was updated successfully, but these errors were encountered: