Skip to content

security: harden IPC, gate DevTools, isolate external windows, exempt /api/version#348

Merged
koala73 merged 3 commits intomainfrom
fix/security-harden-ipc-devtools
Feb 25, 2026
Merged

security: harden IPC, gate DevTools, isolate external windows, exempt /api/version#348
koala73 merged 3 commits intomainfrom
fix/security-harden-ipc-devtools

Conversation

@koala73
Copy link
Owner

@koala73 koala73 commented Feb 25, 2026

Summary

  • IPC origin validation: All sensitive Tauri commands (get_secret, set_secret, get_local_api_token, read_cache_entry, write_cache_entry, fetch_polymarket) now validate the calling window label against a TRUSTED_WINDOWS allowlist. The YouTube login window (external-origin) is blocked from secret/cache/token IPC.
  • DevTools gated behind Cargo feature: tauri/devtools moved from default dependency to opt-in devtools feature. Production builds have no DevTools menu item or keyboard shortcut. desktop:dev script passes -f devtools automatically.
  • YouTube login capability isolation: Separate youtube-login.json capability file with only core:window:default — no access to secret, cache, or token commands.
  • Fetch patch token TTL: LOCAL_API_TOKEN cached in the fetch closure now has a 5-minute TTL and re-fetches on expiry, limiting exposure window.
  • Middleware: exempt /api/version: Desktop update checker and sidecar hit /api/version with non-browser UAs (caught by curl/ regex and short-UA check). Added PUBLIC_API_PATHS allowlist to bypass bot filtering on public endpoints.
  • Docs: Added contributors section, security acknowledgments (Cody Richard), and updated SECURITY.md with desktop-specific threat model documentation.

Test plan

  • npm run desktop:dev — DevTools available via Help menu (Cmd+Alt+I)
  • Production build (desktop:build:full) — no DevTools menu item, Cmd+Alt+I does nothing
  • YouTube login window cannot call get_secret / get_local_api_token via console
  • Main/settings/live-channels windows can still access all IPC commands
  • curl https://worldmonitor.app/api/version returns 200 (not 403)
  • Desktop update check works after deploy
  • tsc --noEmit passes

…ndows

- Remove devtools from default Tauri features; gate behind opt-in
  Cargo feature so production builds never expose DevTools
- Add IPC origin validation (require_trusted_window) to 9 sensitive
  commands: get_secret, get_all_secrets, set_secret, delete_secret,
  get_local_api_token, read/write/delete_cache_entry, fetch_polymarket
- Isolate youtube-login window into restricted capability (core:window
  only) — prevents external-origin webview from invoking app commands
- Add 5-minute TTL to cached sidecar auth token in fetch patch closure
- Document renderer trust boundary threat model in runtime.ts
…y policy

- Add Contributors section to README with all 16 GitHub contributors
- Add Security Acknowledgments crediting Cody Richard for 3 disclosures
- Update SECURITY.md with desktop runtime security model (Tauri IPC
  origin validation, DevTools gating, sidecar auth, capability isolation,
  fetch patch trust boundary)
- Add Tauri-specific items to security report scope
- Correct API key storage description to cover both web and desktop
The desktop update check and sidecar requests were getting 403'd by the
middleware's bot UA filter (curl/) and short UA check.
@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Building Building Preview, Comment Feb 25, 2026 6:13am
worldmonitor-finance Building Building Preview, Comment Feb 25, 2026 6:13am
worldmonitor-happy Building Building Preview, Comment Feb 25, 2026 6:13am
worldmonitor-startup Building Building Preview, Comment Feb 25, 2026 6:13am

Request Review

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@koala73 koala73 merged commit 7ae7b4b into main Feb 25, 2026
4 of 6 checks passed
@koala73 koala73 deleted the fix/security-harden-ipc-devtools branch February 25, 2026 08:03
andreteow pushed a commit to andreteow/worldmonitor-a47 that referenced this pull request Feb 25, 2026
… /api/version (koala73#348)

* security: harden IPC commands, gate DevTools, and isolate external windows

- Remove devtools from default Tauri features; gate behind opt-in
  Cargo feature so production builds never expose DevTools
- Add IPC origin validation (require_trusted_window) to 9 sensitive
  commands: get_secret, get_all_secrets, set_secret, delete_secret,
  get_local_api_token, read/write/delete_cache_entry, fetch_polymarket
- Isolate youtube-login window into restricted capability (core:window
  only) — prevents external-origin webview from invoking app commands
- Add 5-minute TTL to cached sidecar auth token in fetch patch closure
- Document renderer trust boundary threat model in runtime.ts

* docs: add contributors, security acknowledgments, and desktop security policy

- Add Contributors section to README with all 16 GitHub contributors
- Add Security Acknowledgments crediting Cody Richard for 3 disclosures
- Update SECURITY.md with desktop runtime security model (Tauri IPC
  origin validation, DevTools gating, sidecar auth, capability isolation,
  fetch patch trust boundary)
- Add Tauri-specific items to security report scope
- Correct API key storage description to cover both web and desktop

* fix: exempt /api/version from bot-blocking middleware

The desktop update check and sidecar requests were getting 403'd by the
middleware's bot UA filter (curl/) and short UA check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant