diff --git a/renderer/renderer.js b/renderer/renderer.js index b73b181..49f61f6 100644 --- a/renderer/renderer.js +++ b/renderer/renderer.js @@ -142,6 +142,14 @@ if (target) target.scrollIntoView({ behavior: 'smooth' }); return; } + // Only allow http/https protocols + try { + const url = new URL(href); + if (url.protocol !== 'http:' && url.protocol !== 'https:') return; + } catch { + // Relative URLs fail new URL(), but we already handled anchors above + return; + } // External links: open in system browser if (typeof window.electronAPI !== 'undefined' && window.electronAPI.openExternal) { window.electronAPI.openExternal(href);