Skip to content

fix desktop navigation boundary#340

Open
snowopsdev wants to merge 2 commits into
OpenCoworkAI:mainfrom
snowopsdev:fix/desktop-navigation-boundary
Open

fix desktop navigation boundary#340
snowopsdev wants to merge 2 commits into
OpenCoworkAI:mainfrom
snowopsdev:fix/desktop-navigation-boundary

Conversation

@snowopsdev
Copy link
Copy Markdown
Contributor

Summary

  • Add a main-window navigation policy that keeps the Electron app document on the trusted app URL/origin.
  • Block untrusted top-level will-navigate and main-frame will-redirect attempts, while preserving the existing allowlisted external-open behavior.
  • Route Markdown links through a safe renderer helper so workspace Markdown cannot rely on default top-level navigation.
  • Add focused tests for trusted navigation classification and Markdown link classification.

Closes #339

Why

Workspace Markdown is untrusted content rendered inside the desktop app chrome. The app already denied window.open attempts, but top-level navigation and redirects also need to be guarded so a clicked Markdown link cannot replace the trusted app document in the main BrowserWindow.

Test Plan

  • pnpm --filter @open-codesign/desktop exec vitest run src/main/navigation-policy.test.ts src/renderer/src/lib/markdown-links.test.ts src/main/open-external.test.ts
  • pnpm --filter @open-codesign/desktop typecheck
  • pnpm --filter @open-codesign/desktop test
  • pnpm typecheck
  • pnpm lint
  • pnpm test

@github-actions github-actions Bot added the area:desktop apps/desktop (Electron shell, renderer) label May 12, 2026
…into fix/desktop-navigation-boundary

# Conflicts:
#	apps/desktop/src/renderer/src/components/FilesTabView.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desktop apps/desktop (Electron shell, renderer)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden desktop navigation boundary for workspace Markdown links

1 participant