Skip to content

Commit

Permalink
Fix code scanning alert no. 1: Incomplete URL scheme check
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
legobeat and github-advanced-security[bot] authored Oct 8, 2024
1 parent 7e8f3cb commit 0f3c1a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function setupOpenSelfInNewTabLink() {
*/
function isValidSuspectHref(href: string) {
/* eslint-disable-next-line */
const disallowedProtocols = ['javascript:'];
const disallowedProtocols = ['javascript:', 'data:', 'vbscript:'];
const parsedSuspectHref = new URL(href);

return disallowedProtocols.indexOf(parsedSuspectHref.protocol) < 0;
Expand Down

0 comments on commit 0f3c1a6

Please sign in to comment.