Safeguard
Developer Tools•

Flatpak filesystem=host or portals: which should your app use?

For a Flatpak you publish, portals usually beat broad filesystem access. A decision guide on host, home, narrow paths and file chooser portals.

Safeguard Security Team
3 min read

Prefer portals first, then narrow paths, and use --filesystem=host only when the app cannot work otherwise. The Flatpak documentation advises limiting static access and preferring portals, because every static grant is access that a bug or a malicious dependency can use.

What each option gives

OptionAccess givenTrade off
Portal file chooserThe file the user picksLeast access, user driven
Narrow path such as xdg-downloadOne folderPredictable, still static
Read only suffixSame path, no writesCuts damage from a bug
homeThe home directory except ~/.var/appWide
hostAll top level paths except reserved ones, which includes homeWidest

The documentation lists options like :ro for read only and :create, plus XDG shortcuts such as xdg-download and xdg-config. Some paths are reserved, such as /usr and /dev, and ~/.var/app requires explicit access.

A decision guide

  1. Does the app open or save files the user chooses? Use the file chooser portal. No static grant is needed. GTK3 and Qt5 support portals transparently, per the docs.
  2. Does it need one known folder? Grant that folder only, read only if it never writes.
  3. Does it need many folders, like an editor for a whole project tree? Consider whether a portal flow plus user selection is enough. If not, grant the smallest set of paths you can name.
  4. Is host the only way? Write down why, tell users in the app listing and revisit it each release.

Why this matters for supply chain risk

Your app includes dependencies you did not write. A compromised dependency runs with the app's permissions. If the app has host access, the dependency does too. Narrow permissions limit what a bad package can read or change, which makes permissions a supply chain control as well as a privacy one.

Testing a narrower manifest

Remove a permission, run the app, and note what breaks. The documentation suggests flatpak run --log-session-bus $FLATPAK_ID to find the D-Bus permissions an app needs. Add back only what the logs and tests show you need.

Try it yourself

The reachability demo shows how knowing what code can actually be reached cuts noise. Click through it and apply the same idea to permissions: what can your app really reach?

Click through it at your own pace, or open it full screen.

Quick check

Does filesystem=host include my home folder?

Yes. The documentation says host includes home, apart from ~/.var/app.

Can permissions use variables?

No. The documentation says permissions are static and variable expansion is not supported.

Safeguard's reachability analysis and dependency scanning help show which packages in an app matter most. A free scan is at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.