-
Notifications
You must be signed in to change notification settings - Fork 121
Closed
Description
The XSS prevention cheat sheet mentioned the anti-pattern, placing json inside js block.
<script>
var initData = <%= data.to_json %>; // Do NOT do this without encoding the data with one of the techniques listed below.
</script>
This has been a common practice, and is an important part of redux's server rendering. But owasp-java-encoder
doesn't has the right encoding function to deal with it.
Is it consider doable and necessary, to implement Encode.forJSON()
?
From what I read on the cheat sheet, converting <
to \u003c
would be good enough.
Metadata
Metadata
Assignees
Labels
No labels