Skip to content

sec: reduce preload IPC surface — ~298 methods exposed to renderer #42

@0x-SquidSol

Description

@0x-SquidSol

Problem

The preload script (electron/preload/index.ts) exposes approximately 298 IPC methods to the renderer process via contextBridge.exposeInMainWorld(). This includes highly sensitive operations:

  • wallet.exportPrivateKey() — exports private keys
  • wallet.sendSol(), wallet.sendToken() — financial transactions
  • vault.store(), vault.retrieve() — credential storage
  • email.send() — email dispatch
  • deploy.connectVercel() — OAuth token storage

Impact

Any XSS vulnerability in the renderer would grant an attacker full access to all exposed methods. While context isolation and sandbox are properly enabled, the large API surface increases the value of any XSS exploit.

Suggested Approach

  • Audit which methods truly need direct renderer access
  • Gate sensitive operations (key export, transactions, credential storage) behind re-authentication or confirmation dialogs at the IPC handler level
  • Consider splitting the preload into privilege tiers (read-only vs. mutating operations)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions