mirror of
https://github.com/open-webui/desktop.git
synced 2026-11-05 01:27:46 +00:00
[PR #269] fix: harden desktop shell against untrusted webviews and supply chain #237
Labels
No labels
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/desktop#237
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/desktop/pull/269
Author: @ggrace519
Created: 9/6/2026
Status: 🔄 Open
Base:
main← Head:feat/security-hardening📝 Commits (3)
f91d995fix: harden desktop shell against untrusted webviews and supply chainbf094d4fix(pty): ignore resize/write after the process has exited8018ba3test(pty): run the live resize-after-exit case on Windows📊 Changes
42 files changed (+1944 additions, -535 deletions)
View changed files
➕
.github/workflows/ci.yml(+22 -0)📝
.github/workflows/release.yml(+5 -24)📝
CHANGELOG.md(+31 -0)📝
electron-builder.yml(+10 -0)📝
eslint.config.mjs(+19 -1)📝
package-lock.json(+6 -33)📝
package.json(+3 -2)➕
src/main/app-protocol.ts(+82 -0)➕
src/main/guest-webview.ts(+49 -0)📝
src/main/index.ts(+300 -163)➕
src/main/linux-sandbox.ts(+17 -0)➕
src/main/safe-open.ts(+39 -0)➕
src/main/tls.ts(+58 -0)➕
src/main/utils/artifact-integrity.ts(+160 -0)➕
src/main/utils/child-env.ts(+64 -0)➕
src/main/utils/error-message.ts(+4 -0)➕
src/main/utils/hf-paths.ts(+63 -0)📝
src/main/utils/huggingface.ts(+91 -83)📝
src/main/utils/index.ts(+73 -66)➕
src/main/utils/llama-release.ts(+35 -0)...and 22 more files
📄 Description
Description
Guest Open WebUI pages (including remote connections) could invoke the full privileged desktop API via
window.electronAPI[requestData.type]. Remote webviews also received Open Terminal API keys. TLS verification was disabled on every Chromium session. Python, llama.cpp, and Hugging Face GGUF downloads were not checksummed. Linux always launched with--no-sandbox. Packaged Electron fuses were left at insecure defaults. macOS/Windows releases published unsigned fallbacks on codesign failure.This PR allowlists guest IPC, scopes TLS exceptions to user-added connection origins, verifies downloaded artifacts, sandboxes shell windows, pins Electron to 39.8.10 (GHSA-h7rp-cf8h-j98x), keeps Cloudflare Access / SSO login inside the app, and fails closed on unsigned releases.
Production shell windows load
app://renderer/…instead offile://. Dev (npm run dev) is unchanged.Overlaps (maintainers may want to close or rebase):
send()and does not indexelectronAPIwith guest stringsFork-only docs (
CLAUDE.md,DECISIONS.md, develop-branch model) are not in this PR.Security
send()allowlist:token:update,app:info,app:data,window:isFocusedwill-attach-webviewforcessandbox/contextIsolation/ no NodeopenExternalishttp:/https:/mailto:only?blobs=true)--host/--port/--models-diralways from the desktop--no-sandboxonly for AppImage/snap/Flatpak/unpackaged/ELECTRON_DISABLE_SANDBOX=1sandbox: true; drop@electron-toolkit/preloadwindow.electronFixes
app:data(nullinstead of{}— Open WebUI+layout.sveltedoes not importappData)Infrastructure
npm test(23node:testcases on the security helpers)src/main+ preloadRelated Issues
Related to #175, #165. Does not close those if #218 is the intended path for OAuth host allowlisting.
Verification
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.