Oncorporation / CastorLazyPack

Castor's Lazy Pack Development Repository
7 stars 5 forks source link

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

Open Genide opened 5 years ago

Genide commented 5 years ago

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 "" as their text.

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