fix: a security issue related to open external (#13864)

This commit is contained in:
Peng Xiao
2025-11-06 20:54:25 +08:00
committed by GitHub
parent dd676611ce
commit c9a4129a3e
7 changed files with 133 additions and 13 deletions
@@ -1,9 +1,10 @@
import { app, clipboard, nativeImage, nativeTheme, shell } from 'electron';
import { app, clipboard, nativeImage, nativeTheme } from 'electron';
import { getLinkPreview } from 'link-preview-js';
import { isMacOS } from '../../shared/utils';
import { persistentConfig } from '../config-storage/persist';
import { logger } from '../logger';
import { openExternalSafely } from '../security/open-external';
import type { WorkbenchViewMeta } from '../shared-state-schema';
import type { NamespaceHandlers } from '../type';
import {
@@ -151,7 +152,7 @@ export const uiHandlers = {
}
},
openExternal(_, url: string) {
return shell.openExternal(url);
return openExternalSafely(url);
},
// tab handlers