super-productivity/electron/ipc-handlers
Johannes Millan 4e0e2d9ffd
fix(electron): open file:// URLs with special characters on Windows (#8695) (#8698)
* fix(electron): open file:// URLs with special characters (#8695)

Local file:// URLs with non-ASCII names or spaces (e.g. Grüne, "Another
One") failed to open on Windows: both open sinks handed the URL to
shell.openExternal, which percent-encodes the path (ü → %C3%BC, space →
%20) before ShellExecute, so the OS then searched for a literally-named
folder and failed. Pure-ASCII paths worked because there was nothing to
encode.

Route local file: URLs through shell.openPath with a decoded filesystem
path (fileURLToPath) instead. openPath takes a raw path, so Unicode names
and spaces open correctly. This also applies the executable-extension
guard to file: URLs, which previously only ran on the OPEN_PATH sink
(GHSA-hr87-735w-hfq3).

Shared openLocalPath()/isLocalFileUrl() cover both the OPEN_EXTERNAL IPC
handler and the navigation-interception path in main-window.

* test(electron): cover NTLM/exec vectors at the un-pre-gated openPath sink

Follow-up to the #8695 review. Add regression tests locking in that
openLocalPath alone (OPEN_PATH has no scheme pre-gate) blocks the
path-based UNC file: URL (file:////host/share, GHSA-hr87-735w-hfq3) and
an executable hidden behind a percent-encoded dot (evil%2Ebat). Document
that the decode tests run on Linux and therefore don't exercise the
Windows drive-letter/backslash conversion, and clarify why isLocalFileUrl
is intentionally broader than the renderer/scheme-allowlist checks.
2026-07-02 11:47:51 +02:00
..
app-control.ts fix(electron): respect tray title settings #7823 (#8097) 2026-06-08 12:07:09 +02:00
app-data.ts feat(ipc): implement IPC handlers for app control, data, exec, global shortcuts, system, and Jira 2025-11-27 13:44:18 +01:00
global-shortcuts.ts feat(electron): trigger global shortcuts via superproductivity:// URLs (#8645) 2026-06-30 17:22:30 +02:00
index.ts fix(electron): remove exec IPC to close GHSA-256q (#8669) 2026-07-01 17:55:35 +02:00
jira.ts feat(ipc): implement IPC handlers for app control, data, exec, global shortcuts, system, and Jira 2025-11-27 13:44:18 +01:00
system.ts fix(electron): open file:// URLs with special characters on Windows (#8695) (#8698) 2026-07-02 11:47:51 +02:00