Skip to content

Commit ba91d16

Browse files
committed
sec(desktop): narrow capabilities — drop shell:default, process:default, http://*
Replace over-broad default grants with the minimum set the UI actually needs: - shell:default → shell:allow-open (only shellOpen(url) is called from the frontend — no shell:execute). - process:default → process:allow-restart (relaunch is the only usage; exit-arbitrary is not). - http:default now scopes to https://* and the loopback http origins (localhost / 127.0.0.1). Plain-HTTP arbitrary hosts are refused; users who need an insecure remote provider must opt in explicitly rather than getting it by default. - opener:allow-open-path entries with "app": true are removed; the app alias is now validated server-side (validate_open_app_name) and the `open_path` Tauri command already gates the filesystem target (validate_open_target), so the extra "app": true surface is redundant and only widened the XSS blast radius. Closes #8/21.
1 parent baf3463 commit ba91d16

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

packages/desktop/src-tauri/capabilities/default.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@
1212
{ "path": "**/*" },
1313
{ "path": "/**/*" },
1414
{ "path": "**/.*/*/**" },
15-
{ "path": "/**/.*/*/**" },
16-
{ "path": "**/*", "app": true },
17-
{ "path": "/**/*", "app": true },
18-
{ "path": "**/.*/*/**", "app": true },
19-
{ "path": "/**/.*/*/**", "app": true }
15+
{ "path": "/**/.*/*/**" }
2016
]
2117
},
2218
"deep-link:default",
@@ -35,17 +31,24 @@
3531
"core:window:allow-is-maximized",
3632
"core:window:allow-toggle-maximize",
3733
"decorum:allow-show-snap-overlay",
38-
"shell:default",
34+
"shell:allow-open",
3935
"updater:default",
4036
"dialog:default",
41-
"process:default",
37+
"process:allow-restart",
4238
"store:default",
4339
"window-state:default",
4440
"os:default",
4541
"notification:default",
4642
{
4743
"identifier": "http:default",
48-
"allow": [{ "url": "http://*" }, { "url": "https://*" }, { "url": "http://*:*/*" }, { "url": "https://*:*/*" }]
44+
"allow": [
45+
{ "url": "https://*" },
46+
{ "url": "https://*:*/*" },
47+
{ "url": "http://127.0.0.1" },
48+
{ "url": "http://127.0.0.1:*/*" },
49+
{ "url": "http://localhost" },
50+
{ "url": "http://localhost:*/*" }
51+
]
4952
},
5053
"clipboard-manager:allow-read-image"
5154
]

0 commit comments

Comments
 (0)