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

$text command is vulnerable to cross-site scripting #5

Open
Genide opened this issue Apr 7, 2019 · 0 comments
Open

$text command is vulnerable to cross-site scripting #5

Genide opened this issue Apr 7, 2019 · 0 comments

Comments

@Genide
Copy link

Genide commented Apr 7, 2019

When displaying text, the code set innerHTML and displays the value.
text.innerHTML = MySet.message;

This method of setting text if extremely vulnerable to DOM-based cross-site scripting.

For example, if a streamer were to allow a command that takes a viewer's input and display that using $test, the user could maliciously insert "<script>REDIRECT TO ANOTHER SITE</script>" as their text.

To avoid this issue, please use textContent to set values.
text.textContent = MySet.message;

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