Skip to content

fix(chat): chat window without Node, links in the browser - #249

Closed
edospadoni wants to merge 1 commit into
mainfrom
fix/chat-window-isolation
Closed

edospadoni wants to merge 1 commit into
mainfrom
fix/chat-window-isolation

Conversation

@edospadoni

Copy link
Copy Markdown
Member

The chat island window shows messages, images and links sent by colleagues and, with the external guests, by people outside the company. It was created with `nodeIntegration: true` and `contextIsolation: false`: any script that ever ran in that page would have had Node, that is the user's computer.

Now the chat window:

  • has `nodeIntegration: false` and `contextIsolation: true`: the page sees only `window.electron` and `window.api` from the preload, which already exposes them through `contextBridge` when isolated
  • opens `http(s)` links with the system browser and never in an Electron window (`setWindowOpenHandler` denies every new window)
  • cannot navigate away from its own page (`will-navigate`)

The shared logger and env helper no longer assume `process` exists in the page.

The other windows are unchanged. Next steps, separate: `sandbox: true` for this window (the preload uses `os`, so it needs a small rework) and an Electron upgrade (28.x is out of support).

Draft: typecheck and build pass; it needs a run of NethLink to check the chat window (open, send, attachments, links, call buttons, move to CTI).

Found in a security review of the chat.

Refs NethServer/dev#7648

The chat window shows what colleagues and guests send. It ran with
nodeIntegration and without context isolation, so a script in that
page would have had the whole computer. Now it has only the
preload's bridge; links open in the system browser and the page
cannot navigate away from the app.
@github-actions

Copy link
Copy Markdown

Automatic builds from https://github.com/NethServer/nethlink/actions/runs/40851701310.
Commit: 1a8637f

Name Platform Link
win-app.exe Windows (x64) Link
macos-app-x64.dmg MacOS (x64) Link
macos-app-arm64.dmg MacOS (arm64) Link
linux-app.AppImage Linux (x64) Link

@edospadoni
edospadoni marked this pull request as ready for review October 29, 2026 11:36
@edospadoni edospadoni closed this Oct 29, 2026
@edospadoni
edospadoni deleted the fix/chat-window-isolation branch October 29, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant