Skip to content

Commit

Permalink
Fixing Security Vulnerability for shortcuts (#539)
Browse files Browse the repository at this point in the history
* Fixing Security Vulnerability for shortcuts

* Revert as the fixes didn't work

* EncodeURL

Co-Authored-By: Prem Kumar <[email protected]>

---------

Co-authored-by: Prem Kumar <[email protected]>
  • Loading branch information
itz-rj-here and prem-k-r authored Feb 18, 2025
1 parent bf050d8 commit 9be341b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,10 @@ document.addEventListener("DOMContentLoaded", function () {
url = "https://xengshi.github.io/materialYouNewTab/docs/PageNotFound.html";
}

// Normalize URL if valid
const normalizedUrl = url.startsWith('https://') || url.startsWith('http://') ? url : 'https://' + url;
// Normalize and encode URL
const normalizedUrl = encodeURI(
url.startsWith('https://') || url.startsWith('http://') ? url : 'https://' + url
);

const i = shortcut._index;

Expand Down

0 comments on commit 9be341b

Please sign in to comment.