Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

security: isAppPageUrl checks devRendererUrl with startsWith instead of comparing parsed URL origins

Open Beginner friendly
#300 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
electron, typescript
Domain
desktop, security

Research direction

The bug is in isAppPageUrl in src/main/renderer_url.ts (around lines 25-26), where url.startsWith(dev) is used on the dev renderer URL. Start by reading that function and devRendererUrl, then check how ELECTRON_RENDERER_URL is set. Done means both url and dev are parsed with new URL(...) and compared by origin, plus a pathname prefix when dev has a path, and a URL like http://localhost:5173.evil.example/ no longer passes.

Written by the indexing model from the issue text.

Description

priority: low security severity: low

Problem

Found in the Oct 13 audit (at 704a0b7).

In src/main/renderer_url.ts:25-26, isAppPageUrl checks whether an IPC call came from the development server with:

const dev = devRendererUrl(isPackaged, env);
if (dev && url.startsWith(dev)) return true;

Packaged builds ignore ELECTRON_RENDERER_URL (isPackaged is true), so this affects development runs only. However, when ELECTRON_RENDERER_URL has no trailing slash (for example http://localhost:5173), url.startsWith(dev) also matches http://localhost:5173.evil.example/ or http://localhost:[email protected]/.

Fix

Parse both url and dev with new URL(...) and compare origin (plus pathname prefix when dev includes a path).

Dominant language
TypeScript
Stars
2
Forks
2
Avg merge
8h 28m
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PierrunoYT/patch

All issues in PierrunoYT/patch

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.