Skip to content

Commit 426cae7

Browse files
fix: incomplete URL scheme check
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent f7f4c9e commit 426cae7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/react/src/util/sanitizeUrl.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ export function sanitizeUrl(inputUrl: string, baseUrl: string): string {
99
const url = new URL(inputUrl, baseUrl);
1010

1111
// eslint-disable-next-line no-script-url -- false positive, we are explicitly checking if the protocol is safe to prevent XSS
12-
if (url.protocol !== "javascript:") {
12+
if (
13+
url.protocol !== "javascript:" &&
14+
url.protocol !== "data:" &&
15+
url.protocol !== "vbscript:"
16+
) {
1317
return url.href;
1418
}
1519
} catch (error) {

0 commit comments

Comments
 (0)