Replies: 1 comment 1 reply
-
|
Thanks for the detailed security review! I've verified each point against the codebase. Here's my response:
IPC handlers accepting paths — Confirmed, though all these handlers are only called from the app's own UI with paths coming from Electron's native file dialogs (
CORS I will make some fixes in future versions. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Please evaluate if you are interested in a small pull request:
The core problem: Electron's trust boundary was disabled
the renderer (browser) should not have direct access to the main process (Node.js). Three settings collapse this boundary entirely:
nodeIntegration:
truegave the renderer full node.js access. Any XSS or content injection in the renderer becomes full remote code execution on the user's machine.webSecurity:
false— disabled the same-origin policy. Any external content loaded in the app could freely interact with internal resources.contextIsolation was not explicitly set — relying on Electron defaults for the most critical security setting is fragile across version upgrades (?)
The underlying architecture is top notch but
BrowserWindowconfig is undermining it.IPC handlers accepted arbitrary paths
Multiple IPC handlers
(db:move,db:migrate,db:restore,db:delete-backup,fs:assets) accept file paths from the renderer with no validation.It may be of lower risk with the app's own UI as the only caller, any compromise of the renderer (or future attack surface) could read or write arbitrary files. Path traversal checks (.. detection) are the minimum safeguard imho.
shell.openExternalhad no protocol validationThis API opens URLs in the user's default browser or OS handler. Without protocol validation a file://, javascript:, or custom protocol URL could be passed through. Restricting to http:/https: could be entirely useless in the case of the current architecture but worth noting.
The preload bridge exposed a
db.query(sql, params)function that allowes arbitrary SQL execution from the renderer. It was never actually called anywhere in the codebase from my analysis — but its mere existence meant any renderer compromise had direct database access. Just dead code that allows for arbitrary code execution in my eyes.Possibly intended:
API open to any website
The local Elysia REST API runs with
cors({ origin: '*' })As an electron app is this necessary to not restrict?
Beta Was this translation helpful? Give feedback.
All reactions