Skip to content

fix(security): narrow fs and assetProtocol scopes to $HOME - #485

Open
Firefly0619sec wants to merge 1 commit into
winfunc:mainfrom
Firefly0619sec:fix/minimal-fs-scope
Open

Firefly0619sec wants to merge 1 commit into
winfunc:mainfrom
Firefly0619sec:fix/minimal-fs-scope

Conversation

@Firefly0619sec

Copy link
Copy Markdown

Problem

The default capability set is broader than what the GUI actually needs:

  • capabilities/default.json grants fs:read-all and fs:write-all — all filesystem paths, not just the ones the user opens;
  • tauri.conf.json sets assetProtocol.scope to ** — the asset protocol can read any path on disk.

The app already has fs:scope-home-recursive and fs:scope-app-recursive, plus an explicit dialog picker, so the "all paths" grants are redundant for normal use.

Change

  • Remove fs:read-all / fs:write-all (keep the concrete fs:allow-* permissions and the home/app scopes);
  • Narrow assetProtocol.scope from ** to $HOME/**.

Impact

  • Opening projects/files under $HOME keeps working;
  • Paths outside $HOME (e.g. D:\projects) now require the user to pick them via the dialog, or the scope to be extended at runtime — which is the intended least-privilege behavior;
  • This is a security-hardening change, not a functional one; if some workflow depends on reading arbitrary paths, tell me and I'll switch it to a runtime-extended scope instead.

Related

This complements #483 (web server no longer binds 0.0.0.0 by default): together they remove the "unauthenticated LAN access + full-filesystem read/write" combination.

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