Skip to content

Conversation

@wmertens
Copy link
Contributor

This short piece of code renders all html tags in JSON harmless, by replacing the < character with its unicode escape \u003c. Since the only place where JSON can have < is in strings, this is sufficient for protecting JSON from XSS injection.

Providing an easy cut'n'paste solution in the documentation ensures that more people will be protected from this problem.

This short piece of code renders all html tags in JSON harmless, by replacing the `<` character with its unicode escape `\u003c`. Since the only place where JSON can have `<` is in strings, this is sufficient for protecting JSON from XSS injection.
@markerikson
Copy link
Contributor

Not an XSS expert, but sounds like a good thing. Thanks!

@markerikson markerikson merged commit e540d55 into reduxjs:master Nov 25, 2016
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

Successfully merging this pull request may close these issues.

2 participants