fix(ipc): declare the app commands and grant them to the app origin (Tauri 2.11+ ACL)

With Tauri 2.12 every app command was refused ("Command … not allowed by
ACL"): the app is served from http://localhost:44548 (tauri-plugin-
localhost), which Tauri treats as a remote origin, and since the
GHSA-7gmj-67g7-phm9 fix app commands need an explicit capability. The
Windows smoke test caught it (keychain, hotkeys, tray/taskbar/thumbbar,
token migration all failed).

build.rs now declares the 35 commands as an app manifest, and
capabilities/migrated.json (scoped to http://localhost:44548 only) grants
allow-<command> for each. The call page (http://127.0.0.1:44548) and any
remote frame still get no IPC. gen/schemas regenerated by tauri-build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
This commit is contained in:
Lotus CIandClaude Opus 5.5 committed 2026-10-26 01:59:33 -04:00
1 parent e3bc4e128f
commit 7fecf72107
6 files changed
+1333 -8481

No files matched your search

+46 -1
View File
@@ -1,3 +1,48 @@
fn main() { fn main() {
tauri_build::build() // Tauri 2.11+ only lets a page call app commands that a capability allows
// (GHSA-7gmj-67g7-phm9). Declaring them here generates an `allow-<name>`
// permission for each; capabilities/migrated.json grants them to the app's
// own origin (http://localhost:44548) and nothing else, so the call page
// (http://127.0.0.1:44548) and remote frames still get no IPC.
// Keep this list in sync with `generate_handler!` in src/lib.rs.
tauri_build::try_build(tauri_build::Attributes::new().app_manifest(
tauri_build::AppManifest::new().commands(&[
"check_for_update",
"flash_window",
"focus_main_window",
"get_close_behavior",
"get_focus_assist",
"get_start_minimized",
"get_tray_dnd",
"global_hotkeys_supported",
"has_tray_host",
"install_update",
"resolve_close_request",
"secure_session_clear",
"secure_session_get",
"secure_session_set",
"secure_session_supported",
"send_notification",
"set_badge_count",
"set_call_active",
"set_close_behavior",
"set_custom_chrome",
"set_global_hotkeys",
"set_jump_list",
"set_smtc_call_state",
"set_start_minimized",
"set_taskbar_progress",
"set_thumbbar",
"set_tray_call_state",
"set_tray_unread",
"set_tray_update_ready",
"show_rich_toast",
"update_install_kind",
"window_close",
"window_minimize",
"window_start_drag",
"window_toggle_maximize",
]),
))
.expect("failed to run tauri-build");
} }
+44 -2
View File
@@ -53,7 +53,49 @@
"autostart:allow-is-enabled", "autostart:allow-is-enabled",
{ {
"identifier": "opener:allow-open-url", "identifier": "opener:allow-open-url",
"allow": [{ "url": "http://*" }, { "url": "https://*" }] "allow": [
} {
"url": "http://*"
},
{
"url": "https://*"
}
]
},
"allow-check-for-update",
"allow-flash-window",
"allow-focus-main-window",
"allow-get-close-behavior",
"allow-get-focus-assist",
"allow-get-start-minimized",
"allow-get-tray-dnd",
"allow-global-hotkeys-supported",
"allow-has-tray-host",
"allow-install-update",
"allow-resolve-close-request",
"allow-secure-session-clear",
"allow-secure-session-get",
"allow-secure-session-set",
"allow-secure-session-supported",
"allow-send-notification",
"allow-set-badge-count",
"allow-set-call-active",
"allow-set-close-behavior",
"allow-set-custom-chrome",
"allow-set-global-hotkeys",
"allow-set-jump-list",
"allow-set-smtc-call-state",
"allow-set-start-minimized",
"allow-set-taskbar-progress",
"allow-set-thumbbar",
"allow-set-tray-call-state",
"allow-set-tray-unread",
"allow-set-tray-update-ready",
"allow-show-rich-toast",
"allow-update-install-kind",
"allow-window-close",
"allow-window-minimize",
"allow-window-start-drag",
"allow-window-toggle-maximize"
] ]
} }
+1 -1
View File
@@ -1 +1 @@
{"clipboard-manager":{"default_permission":{"identifier":"default","description":"No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n","permissions":[]},"permissions":{"allow-clear":{"identifier":"allow-clear","description":"Enables the clear command without any pre-configured scope.","commands":{"allow":["clear"],"deny":[]}},"allow-read-image":{"identifier":"allow-read-image","description":"Enables the read_image command without any pre-configured scope.","commands":{"allow":["read_image"],"deny":[]}},"allow-read-text":{"identifier":"allow-read-text","description":"Enables the read_text command without any pre-configured scope.","commands":{"allow":["read_text"],"deny":[]}},"allow-write-html":{"identifier":"allow-write-html","description":"Enables the write_html command without any pre-configured scope.","commands":{"allow":["write_html"],"deny":[]}},"allow-write-image":{"identifier":"allow-write-image","description":"Enables the write_image command without any pre-configured scope.","commands":{"allow":["write_image"],"deny":[]}},"allow-write-text":{"identifier":"allow-write-text","description":"Enables the write_text command without any pre-configured scope.","commands":{"allow":["write_text"],"deny":[]}},"deny-clear":{"identifier":"deny-clear","description":"Denies the clear command without any pre-configured scope.","commands":{"allow":[],"deny":["clear"]}},"deny-read-image":{"identifier":"deny-read-image","description":"Denies the read_image command without any pre-configured scope.","commands":{"allow":[],"deny":["read_image"]}},"deny-read-text":{"identifier":"deny-read-text","description":"Denies the read_text command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text"]}},"deny-write-html":{"identifier":"deny-write-html","description":"Denies the write_html command without any pre-configured scope.","commands":{"allow":[],"deny":["write_html"]}},"deny-write-image":{"identifier":"deny-write-image","description":"Denies the write_image command without any pre-configured scope.","commands":{"allow":[],"deny":["write_image"]}},"deny-write-text":{"identifier":"deny-write-text","description":"Denies the write_text command without any pre-configured scope.","commands":{"allow":[],"deny":["write_text"]}}},"permission_sets":{},"global_scope_schema":null},"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"alLine truncated {"__app-acl__":{"default_permission":null,"permissions":{"allow-check-for-update":{"identifier":"allow-check-for-update","description":"Enables the check_for_update command without any pre-configured scope.","commands":{"allow":["check_for_update"],"deny":[]}},"allow-flash-window":{"identifier":"allow-flash-window","description":"Enables the flash_window command without any pre-configured scope.","commands":{"allow":["flash_window"],"deny":[]}},"allow-focus-main-window":{"identifier":"allow-focus-main-window","description":"Enables the focus_main_window command without any pre-configured scope.","commands":{"allow":["focus_main_window"],"deny":[]}},"allow-get-close-behavior":{"identifier":"allow-get-close-behavior","description":"Enables the get_close_behavior command without any pre-configured scope.","commands":{"allow":["get_close_behavior"],"deny":[]}},"allow-get-focus-assist":{"identifier":"allow-get-focus-assist","description":"Enables the get_focus_assist command without any pre-configured scope.","commands":{"allow":["get_focus_assist"],"deny":[]}},"allow-get-start-minimized":{"identifier":"allow-get-start-minimized","description":"Enables the get_start_minimized command without any pre-configured scope.","commands":{"allow":["get_start_minimized"],"deny":[]}},"allow-get-tray-dnd":{"identifier":"allow-get-tray-dnd","description":"Enables the get_tray_dnd command without any pre-configured scope.","commands":{"allow":["get_tray_dnd"],"deny":[]}},"allow-global-hotkeys-supported":{"identifier":"allow-global-hotkeys-supported","description":"Enables the global_hotkeys_supported command without any pre-configured scope.","commands":{"allow":["global_hotkeys_supported"],"deny":[]}},"allow-has-tray-host":{"identifier":"allow-has-tray-host","description":"Enables the has_tray_host command without any pre-configured scope.","commands":{"allow":["has_tray_host"],"deny":[]}},"allow-install-update":{"identifier":"allow-install-update","description":"Enables the install_update command without any pre-configured scope.","commands":{"allow":["install_update"],"deny":[]}},"allow-resolve-close-request":{"identifier":"allow-resolve-close-request","description":"Enables the resolve_close_request command without any pre-configured scope.","commands":{"allow":["resolve_close_request"],"deny":[]}},"allow-secure-session-clear":{"identifier":"allow-secure-session-clear","description":"Enables the secure_session_clear command without any pre-configured scope.","commands":{"allow":["secure_session_clear"],"deny":[]}},"allow-secure-session-get":{"identifier":"allow-secure-session-get","description":"Enables the secure_session_get command without any pre-configured scope.","commands":{"allow":["secure_session_get"],"deny":[]}},"allow-secure-session-set":{"identifier":"allow-secure-session-set","description":"Enables the secure_session_set command without any pre-configured scope.","commands":{"allow":["secure_session_set"],"deny":[]}},"allow-secure-session-supported":{"identifier":"allow-secure-session-supported","description":"Enables the secure_session_supported command without any pre-configured scope.","commands":{"allow":["secure_session_supported"],"deny":[]}},"allow-send-notification":{"identifier":"allow-send-notification","description":"Enables the send_notification command without any pre-configured scope.","commands":{"allow":["send_notification"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-call-active":{"identifier":"allow-set-call-active","description":"Enables the set_call_active command without any pre-configured scope.","commands":{"allow":["set_call_active"],"deny":[]}},"allow-set-close-behavior":{"identifier":"allow-set-close-behavior","description":"Enables the set_close_behavior command without any pre-configured scope.","commands":{"allow":["set_close_behavior"],"deny":[]}},"allow-set-custom-chrome":{"identifier":"allow-set-custom-chrome","description":"Enables the set_custom_chrome command without any pre-configured scope.","commands":{"allow":["set_custom_chrome"],"deny":[]}},"allow-set-global-hotkeys":{"identifier":"allow-set-global-hotkeys","description":"Enables the set_global_hotkeys command without any pre-configured scope.","commands":{"allow":["set_global_hotkeys"],"deny":[]}},"allow-set-jump-list":{"identifier":"allow-set-jump-list","description":"Enables the set_jump_list command without any pre-configured scope.","commands":{"allow":["set_jump_list"],"deny":[]}},"allow-set-smtc-call-state":{"identifier":"allow-set-smtc-call-state","description":"Enables the set_smtc_call_state command without any pre-configured scope.","commands":{"allow":["set_smtc_call_state"],"deny":[]}},"allow-set-start-minimized":{"identifier":"allow-set-start-minimized","description":"Enables the set_start_minimized command without any pre-confiLine truncated
+1 -1
View File
@@ -1 +1 @@
{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"windows":["main"],"permissions":["updater:default","global-shortcut:default"],"platforms":["macOS","windows","linux"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","fs:allow-read-file","fs:allow-write-file","fs:allow-read-dir","fs:allow-copy-file","fs:allow-mkdir","fs:allow-remove","fs:allow-remove","fs:allow-rename","fs:allow-exists","core:window:allow-create","core:window:allow-center","core:window:allow-request-user-attention","core:window:allow-set-resizable","core:window:allow-set-maximizable","core:window:allow-set-minimizable","core:window:allow-set-closable","core:window:allow-set-title","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-decorations","core:window:allow-set-always-on-top","core:window:allow-set-content-protected","core:window:allow-set-size","core:window:allow-set-min-size","core:window:allow-set-max-size","core:window:allow-set-position","core:window:allow-set-fullscreen","core:window:allow-set-focus","core:window:allow-set-icon","core:window:allow-set-skip-taskbar","core:window:allow-set-cursor-grab","core:window:allow-set-cursor-visible","core:window:allow-set-cursor-icon","core:window:allow-set-cursor-position","core:window:allow-set-ignore-cursor-events","core:window:allow-start-dragging","core:webview:allow-print","shell:allow-execute","shell:allow-open","dialog:allow-open","dialog:allow-save","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","http:default","notification:default","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-register-all","global-shortcut:allow-unregister","global-shortcut:allow-unregister-all","os:allow-platform","os:allow-version","os:allow-os-type","os:allow-family","os:allow-arch","os:allow-exe-extension","os:allow-locale","os:allow-hostname","process:allow-restart","process:allow-exit","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","clipboard-manager:default",{"identifier":"opener:allow-open-url","allow":[{"url":"http://*"},{"url":"https://*"}]}]}} {"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"windows":["main"],"permissions":["updater:default","deep-link:default"],"platforms":["macOS","windows","linux"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","remote":{"urls":["http://localhost:44548"]},"local":true,"windows":["main"],"permissions":["core:default","core:window:allow-create","core:window:allow-center","core:window:allow-request-user-attention","core:window:allow-set-resizable","core:window:allow-set-maximizable","core:window:allow-set-minimizable","core:window:allow-set-closable","core:window:allow-set-title","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-decorations","core:window:allow-set-always-on-top","core:window:allow-set-content-protected","core:window:allow-set-size","core:window:allow-set-min-size","core:window:allow-set-max-size","core:window:allow-set-position","core:window:allow-set-fullscreen","core:window:allow-set-focus","core:window:allow-set-icon","core:window:allow-set-skip-taskbar","core:window:allow-set-cursor-grab","core:window:allow-set-cursor-visible","core:window:allow-set-cursor-icon","core:window:allow-set-cursor-position","core:window:allow-set-ignore-cursor-events","core:window:allow-start-dragging","core:webview:allow-print","notification:default","core:app:allow-app-show","core:app:allow-app-hide","autostart:allow-enable","autostart:allow-disable","autostart:allow-is-enabled",{"identifier":"opener:allow-open-url","allow":[{"url":"http://*"},{"url":"https://*"}]},"allow-check-for-update","allow-flash-window","allow-focus-main-window","allow-get-close-behavior","allow-get-focus-assist","allow-get-start-minimized","allow-get-tray-dnd","allow-global-hotkeys-supported","allow-has-tray-host","allow-install-update","allow-resolve-close-request","allow-secure-session-clear","allow-secure-session-get","allow-secure-session-set","allow-secure-session-supported","allow-send-notification","allow-set-badge-count","allow-set-call-active","allow-set-close-behavior","allow-set-custom-chrome","allow-set-global-hotkeys","allow-set-jump-list","allow-set-smtc-call-state","allow-set-start-minimized","allow-set-taskbar-progress","allow-set-thumbbar","allow-set-tray-call-state","allow-set-tray-unread","allow-set-tray-update-ready","allow-show-rich-toast","allow-update-install-kind","allow-window-close","allow-window-minimize","allow-window-start-drag","allow-window-toggle-maximize"]}}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff