Skip to content

security: assert ELECTRON_RENDERER_URL is local-only in development #284

@Shieldxx

Description

@Shieldxx

Summary

In development mode, the main window loads process.env['ELECTRON_RENDERER_URL'] via loadURL without asserting the URL is local-only.

Details

Packaged builds use loadFile so this is not a production vulnerability. However, in a compromised development environment a malicious environment variable could load an untrusted renderer that receives the full preload API.

File: src/main/window.ts

Recommended fix

Assert the URL starts with http://localhost or http://127.0.0.1 before calling loadURL. Fail closed if non-local or invalid. Keep the existing !app.isPackaged guard in place.

Source

Security audit v0.9.0 (Codex) — L-02.

Metadata

Metadata

Assignees

No one assigned

    Labels

    securitySecurity vulnerability or hardening

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions