fix(runtime): apply TypeScript core external_links policy - #371
Open
yusufesse wants to merge 1 commit into
Open
Conversation
TypeScript cores never copied app.zon security.navigation.external_links into runWithOptions, so Cmd.openExternalUrl stayed deny-by-default and failed silently.
|
@yusufesse is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Verified locally on this branch with a temporary (uncommitted) TypeScript
The example edits were local only and are not part of this PR. |
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
app.zonsecurity.navigation.external_linksintorunWithOptions, so the policy stayed at the deny-by-default empty allowlist.Cmd.openExternalUrlis then rejected asNavigationDenied. The host send is fire-and-forget (catch {}), so allowed HTTP(S) URLs never open a system browser and the app shows no error.actionandallowed_urlsfrom the manifest the same way it already reads navigation origins.Docs already describe this gate (
https://native-sdk.dev/security). Wildcard patterns must end in*and include a/after the host (https://example.com/*is valid;https://example.com*is not).Test plan
zig build testandzig build validate(root suites fromscripts/gate.sh fast)zig build test-examples-frontendsand the render bench-checknpm ci --include=devinpackages/core, thenzig build test-examples-nativezig build test-example-kanbanandzig build test-example-gpu-components(compile the staged TypeScript runner against realapp.zonmanifests that setexternal_links.action = "deny").external_links = .{ .action = "open_system_browser", .allowed_urls = .{ "https://example.com/*" } }(temporary localapp.zononly; not committed). This is the pathnative checkdoes not compile.allowsExternalUrlmatcher rules, andopenExternalUrlsucceeding forhttps://example.com/docs/ failing for a non-matching URL on the null platformexamples/chatbotharness):open_system_browser+https://example.com/*opened the system browser tohttps://example.com/docs;.action = "deny"on the same button opened nothing and showed no errornode --test packages/core/test/services.test.tsandpackages/core/test/surface_tools.test.ts(gate-mapped forsrc/**; not specific to this wiring)scripts/gate.sh fastalso mappedexamples-mobile; that step fails on this machine (no Apple iOS SDK) and does not compilets_core_main.zig.