fix(plugin): lock windows to the origin they first load from - #17
Merged
Merged
Conversation
This was referenced Sep 24, 2026
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
zippy
force-pushed
the
security/navigation-lock
branch
from
September 24, 2026 18:13
f492d78 to
c66a1d2
Compare
zippy
marked this pull request as ready for review
September 25, 2026 14:38
mattyg
reviewed
Sep 28, 2026
mattyg
reviewed
Sep 28, 2026
1 of 2 tasks
mattyg
previously approved these changes
Sep 29, 2026
mattyg
approved these changes
Sep 30, 2026
zippy
enabled auto-merge (rebase)
September 30, 2026 15:22
zippy
force-pushed
the
security/navigation-lock
branch
from
September 30, 2026 15:22
fd6d87d to
c4ca0a1
Compare
Record each webview's origin from its first navigation or page load and refuse navigation anywhere else, except blob: URLs of that origin; window.open and target=_blank open nothing. main_window_builder applies this, and HolochainPlugin::lock_navigation applies it to windows an app builds itself. on_new_window needs Tauri 2.8, so the workspace floor moves to 2.8.0.
The legacy path attached an app interface with AllowedOrigins::Any and injected a reusable, non-expiring token into the page. No consumer uses it, so remove it rather than harden it (supersedes #19). BREAKING CHANGE: WindowOptions::use_app_websocket, the injected __HC_LAUNCHER_ENV__, Runtime::ensure_app_websocket, Runtime::setup_app and AppAuth are removed. Use Runtime::install_app_if_missing instead of setup_app.
zippy
force-pushed
the
security/navigation-lock
branch
from
September 30, 2026 15:35
c4ca0a1 to
162aea0
Compare
|
✔️ e7de910...162aea0 - Conventional commits check succeeded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Windows from
main_window_builderare confined to the origin they first load from. Without this, a link could replace the app's UI with a remote page that keeps the window's IPC access.The origin is recorded from the webview's first navigation, or its first page load on Android, where the initial load never reaches the navigation handler. It is observed rather than predicted from the config, so mobile dev proxies,
use_https_schemeand the custom-protocol rewrites on Windows and Android do not produce a blank window.blob:URLs of the origin are allowed, so a UI can still hand the user a file.data:URLs are refused.window.openandtarget="_blank"open nothing. Tauri has noon_new_windowon mobile, so Android loads the target in the same webview, where the navigation check applies, and iOS opens nothing.HolochainPlugin::lock_navigationapplies the same policy to windows an app builds itself.navigation_allowed,origin_ofandsame_originare public.on_new_windowarrived in Tauri 2.8. The workspace floor moves from 2.5.1 to 2.11, the version CI builds.Two follow-up PRs stack on this one: the Linux media grant and the legacy websocket origins. Both use the origin record added here.
TODO:
npm run cipasses