Skip to content

Commit

Permalink
Fix XSS vulnerability by validating user input stream URL.
Browse files Browse the repository at this point in the history
(cherry picked from commit 4a303bd)
  • Loading branch information
yemaw authored and robwalch committed Jul 3, 2024
1 parent 7d2a971 commit 1c8f055
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,17 @@ function loadSelectedStream() {

url = $('#streamURL').val();

// Check if the URL is valid to avoid XSS issue.
if (url) {
try {
new URL(url);
} catch (error) {
$('#streamURL').val('');
alert('Invalid URL');
return false;
}
}

setupGlobals();
hideCanvas();

Expand Down

0 comments on commit 1c8f055

Please sign in to comment.