Skip to content

Commit 50e5222

Browse files
authored
Merge commit from fork
CVE-2026-40171 GHSA-rch3-82jr-f9w9
1 parent 2e642f0 commit 50e5222

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

packages/help-extension/src/index.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ namespace CommandIDs {
4343
export const about = 'help:about';
4444
}
4545

46+
// CVE-2026-40171 / GHSA-rch3-82jr-f9w9
47+
function isUrlSafe(url: string): boolean {
48+
try {
49+
const parsed = new URL(url, window.location.href);
50+
const protocol = parsed.protocol.toLowerCase();
51+
return ['http:', 'https:', 'mailto:'].includes(protocol);
52+
} catch {
53+
return false;
54+
}
55+
}
56+
4657
/**
4758
* A plugin to open the about section with resources.
4859
*/
@@ -57,6 +68,10 @@ const open: JupyterFrontEndPlugin<void> = {
5768
label: (args) => args['text'] as string,
5869
execute: (args) => {
5970
const url = args['url'] as string;
71+
if (!isUrlSafe(url)) {
72+
console.warn(`Blocked unsafe URL: ${url}`);
73+
return;
74+
}
6075
window.open(url);
6176
},
6277
});

0 commit comments

Comments
 (0)