Skip to content
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

Add <!--<script> to the list of strings #222

Open
KamilaBorowska opened this issue Sep 30, 2020 · 0 comments
Open

Add <!--<script> to the list of strings #222

KamilaBorowska opened this issue Sep 30, 2020 · 0 comments

Comments

@KamilaBorowska
Copy link

Following string should be on list of strings.

<!--<script>

The idea here is that such a string would cause denial of service (JavaScript fails to load) attack on certain JSON encoders. For instance, consider the following HTML page.

<!DOCTYPE html>
<script>
var p = "<!--<script>"
// </script>
document.write("Script doesn't close!")
</script>

Putting <!--<script> in a string has an unusual property of making </script> not work.

Some JSON encoders (such as one in PHP) encode slashes which prevents </script> escape:

$ php -r 'echo json_encode("/");'
"\/"

This does nothing again <!--<script>

$ php -r 'echo json_encode("<!--<script>");'
"<!--<script>"
pradeepthakur-lab added a commit to pradeepthakur-lab/big-list-of-naughty-strings that referenced this issue Apr 6, 2023
Added <!--<script> to the list of strings
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

No branches or pull requests

1 participant