Web Security · Middle · Question 12 of 75

Server-rendered state is embedded like this: <script>window.__STATE__ = ${JSON.stringify(state)}</script>. What's the problem?

Explanation

The HTML parser sees </script> before JavaScript runs. Frameworks and serializers that are made for this escape <, > and /.

Further reading

Problem with a question

Web Security · Middle · question 12

Test yourself

Take the Web Security · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz