-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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 request: ability to configure a custom html escaping function. #2611
Comments
Why? |
My organization's XSS policy is not 'escape all the things'. We have to strip out some tags (like script) and we don't escape other tags (like a). I know this is a stupid policy, but changing the policy now would require rewriting a bunch of legacy code, handling of white-listed tags in existing data, rewriting security test suites, and a new external security audit. Instead we have to do this all over our React components:
Being able to configure the default escaping function, or offering something similar to the syntax below would make our code a lot cleaner.
|
Not escaping the Also, you can have your custom escape function create the __html field, as shown here:
Allowing you to do: Which mostly gets you what you want. It doesn't make sense to add a feature in order to support a broken security policy. I'm going to close out this bug, unless someone has a stronger motivating reason for such a feature. |
In my case our custom escaping function properly handles the case of |
No description provided.
The text was updated successfully, but these errors were encountered: