From 7eb7507229cec9dbf0fe0a2c69139970cd970ac5 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 30 Jun 2025 20:04:31 +0200 Subject: [PATCH] Enable ptrace prevention on Linux (except snap) (#15204) --- apps/desktop/src/main/window.main.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/main/window.main.ts b/apps/desktop/src/main/window.main.ts index f1a55866079..4d9438b588d 100644 --- a/apps/desktop/src/main/window.main.ts +++ b/apps/desktop/src/main/window.main.ts @@ -16,7 +16,15 @@ import { BiometricStateService } from "@bitwarden/key-management"; import { WindowState } from "../platform/models/domain/window-state"; import { applyMainWindowStyles, applyPopupModalStyles } from "../platform/popup-modal-styles"; import { DesktopSettingsService } from "../platform/services/desktop-settings.service"; -import { cleanUserAgent, isDev, isLinux, isMac, isMacAppStore, isWindows } from "../utils"; +import { + cleanUserAgent, + isDev, + isLinux, + isMac, + isMacAppStore, + isSnapStore, + isWindows, +} from "../utils"; const mainWindowSizeKey = "mainWindowSize"; const WindowEventHandlingDelay = 100; @@ -156,9 +164,8 @@ export class WindowMain { } } - // this currently breaks the file portal, so should only be used when - // no files are needed but security requirements are super high https://github.com/flatpak/xdg-desktop-portal/issues/785 - if (process.env.EXPERIMENTAL_PREVENT_DEBUGGER_MEMORY_ACCESS === "true") { + // this currently breaks the file portal for snap https://github.com/flatpak/xdg-desktop-portal/issues/785 + if (!isSnapStore()) { this.logService.info("Disabling memory dumps in main process"); try { await processisolations.disableMemoryAccess();