Skip to content

Security: Electron setWindowOpenHandler Allows file:// and data: Protocol Loading #172

@rishab11250

Description

@rishab11250

Summary

setWindowOpenHandler allows any URL not starting with http to load in the BrowserWindow including file://, data:, and ftp://. A compromised Flask response can read local files.

Location

main.js — setWindowOpenHandler, lines ~164-169

Risk

Local file read via renderer navigation. data: URLs can run arbitrary JS.

Proposed Fix

Change the final return from { action: 'allow' } to { action: 'deny' }.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions