Commit Graph
8729 Commits
Author SHA1 Message Date
Simon McVittie 10b5972dfe Prepare v1.19.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.19.2
2026-09-28 14:18:41 +01:00
Simon McVittie e8b4f1ed71 workflows: Use the bubblewrap from our PPA when building the release
Github's ubuntu-latest is currently 24.04, and the bubblewrap in
Ubuntu 24.04 doesn't have everything that we need.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 14:16:04 +01:00
Simon McVittie 75bdf1449b Prepare v1.19.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.19.1
2026-09-28 12:49:40 +01:00
Simon McVittie 9b54043a00 Update translation files for 1.19.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 12:48:02 +01:00
Simon McVittie 04b18e1048 NEWS: Mention improved hardening as a separate change
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 12:44:13 +01:00
Simon McVittie 486e6298af NEWS: Also mention internal changes to older NEWS entries
This is a security release, we don't want anyone getting excited about
undocumented changes.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:15:36 +01:00
Simon McVittie a9aabe6c75 NEWS: Add details of security fixes in 1.19.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:08:54 +01:00
Simon McVittie 415a3fc858 NEWS: Make more consistent with previous items
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:08:40 +01:00
Simon McVittie a7f457b0a0 NEWS: Remove some unnecessary U+200E LEFT-TO-RIGHT MARK
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:05:44 +01:00
Simon McVittie 5e5d0de632 NEWS: Add CVE IDs and reporter credits for the security fixes in 1.19.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 10:05:20 +01:00
Sebastian Wick ab6b2e9fb4 common: Restrict tmpdir permissions from 0777 to 0755
flatpak_allocate_tmpdir created child repo directories (repo- and
child-oci-) with mode 0777, allowing any local user to modify their
contents between the client pull and the system helper deploy.

Use 0755 instead, which prevents other users from writing while
still allowing the revokefs-fuse frontend to read the backing store
directly. The frontend runs as the calling user while the writer
backend runs as the flatpak system user, so the frontend needs
read access to directories created by the backend. Mode 0700 would
break this.

Resolves: CVE-2026-97026
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-r9w3-qx54-qvc8
2026-09-28 09:44:36 +01:00
Sebastian Wick 30faeb539b oci: Stop persisting bearer token to child repo on disk
The .token file was written into the child-oci directory so the
system helper could read it back for remote registry verification.
However, the system helper only ever opens the child-oci registry
as a local source (dfd != -1), and every code path that uses
self->token for HTTP requests is gated behind dfd == -1. The token
was never reachable since it was introduced in commit 5d8fd2d1b.

Persisting credentials to a world-traversable directory in /var/tmp
is a security risk on multi-user systems. Remove the file write
from set_token and the file read from ensure_local. The token
remains available in memory for the client process that actually
needs it for remote access.

Resolves: CVE-2026-97025
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-7rvf-rqr3-43j4
2026-09-28 09:44:36 +01:00
Sebastian Wick c5e82197fc dir: Use deploy helpers in apply_extra_data and flatpak_dir_deploy
Convert remaining call sites to use flatpak_deploy_get_files_fd and
flatpak_deploy_get_metadata_fd.

In flatpak_dir_deploy, metadata was read via GFile with no symlink
protection and all errors silently ignored. Use the metadata helper
which rejects symlinks and only tolerates ENOENT.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick 9f2f3fd5d5 dir: Reuse app_files_dfd for .ref write during deploy
The previous code built a path from checkoutdir_basename + "files" and
opened it via glnx_opendirat(deploy_base_dfd, ...). Since O_NOFOLLOW
only applies to the last path component, a symlink at the intermediate
checkoutdir_basename component would be followed. Reuse the
already-open app_files_dfd instead.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick b24b3b2485 run: Use deploy helper to open runtime files directory
The runtime files directory was opened with open() using O_PATH but
without symlink protection, unlike the app files path which used
O_NOFOLLOW. Since "files" is validated as a non-symlink during deploy,
this is not exploitable through normal install flow. However, the open
should still use safe fd-relative operations as defense-in-depth.

Use flatpak_deploy_get_files_fd which validates the path with
glnx_chaseat(GLNX_CHASE_RESOLVE_NO_SYMLINKS), rejecting any symlink
at the directory boundary.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick 66b8c2c5eb dir: Use fd-relative operations in deploy_dir_is_locked
dir_is_locked() used g_file_resolve_relative_path to construct the
path to files/.ref, then open() without O_NOFOLLOW. Since "files" is
validated as a non-symlink during deploy and ".ref" is atomically
created as a regular file, this is not exploitable through normal
install flow. However, the function should still use safe fd-relative
operations as defense-in-depth.

Rename dir_is_locked to deploy_dir_is_locked to reflect that it
operates specifically on deploy directories, not arbitrary ones.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick 1000c71d40 dir: Use fd-relative operations for files/etc during runtime deploy
The runtime deploy path used GFile operations to manipulate files
inside files/etc (passwd, group, machine-id, resolv.conf). While
the "files" directory is validated with glnx_chaseat using
GLNX_CHASE_RESOLVE_NO_SYMLINKS, "etc" inside it is not checked.
A malicious runtime with files/etc as a symlink causes the GFile
operations (g_file_delete, g_file_replace_contents,
g_file_make_symbolic_link) to follow it and modify files at the
symlink target. On system installs (running as root), this modifies
arbitrary files — e.g. replacing /etc/resolv.conf.

This commit uses fd-based operations to prevent to prevent the symlink
attack.

Resolves: CVE-2026-97024
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick 273ff1728e dir: Use fd-relative operations for app export during deploy
The app branch in flatpak_dir_deploy() used GFile operations to
create directories and write wrapper scripts under the export
directory. While the export symlink is already rejected by the
common-path bin removal, convert the app branch to fd-relative
operations as defense-in-depth.

Use fd-relative operations in export_dir and flatpak_rewrite_export_dir
to reject symlinks.

Hardening related to CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Sebastian Wick f9f16a3e53 dir: Use fd-relative operations for export/bin removal during deploy
The export directory cleanup during deploy used flatpak_rm_rf which
wraps glnx_shutil_rm_rf_at(AT_FDCWD, path). The kernel resolves
intermediate symlinks in the path, so a malicious ostree commit with
"export" as a symlink causes flatpak_rm_rf(export/bin) to delete files
at the symlink target. On system installs (running as root), this is
arbitrary file deletion.

This commit uses fd-based operations to prevent to prevent the symlink
attack.

Resolves: CVE-2026-97023
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
2026-09-28 09:44:36 +01:00
Sebastian Wick 2536aef298 dir: Add fd-relative helpers for accessing deploy directories
Add deploy_open_fd, flatpak_deploy_get_files_fd,
flatpak_deploy_get_export_fd, and flatpak_deploy_get_metadata_fd which
open files within a deploy directory using fd-relative operations with
symlink protection.

deploy_open_fd uses a two-step resolution:
GLNX_CHASE_RESOLVE_NO_SYMLINKS at the directory boundary (files/,
export/) to reject symlinks, then GLNX_CHASE_RESOLVE_BENEATH within the
directory to safely resolve symlinks relative to the directory root.

These will be used by subsequent commits to close TOCTOU gaps where
GFile path operations were used after fd-based validation.

Prerequsite for fixing CVE-2026-97023, CVE-2026-97024

Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-5p67-xh8x-rq54
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-8xgq-v545-vgvf
2026-09-28 09:44:36 +01:00
Markus Göllnitz 4256580bcc dir: Validate Desktop Entry and D-Bus Service
D-Bus Services and Desktop Entries could be extended
through custom keys. D-Bus daemons and desktop
environments augment Applications this way

Besides validating Exec= and D-Bus Service Name=, these
could lead to denial of service, e.g. X-GNOME-AutoRestart
in Desktop Entries, or even code exection outside the
sandbox, e.g. SystemdService in D-Bus Services.

The only reasonable way to ensure non of these make it
through, is exporting only know acceptable ones, instead
of hoping to aggregate every problematic one.

See: https://specifications.freedesktop.org/desktop-entry/latest/index.html
See: https://dbus.freedesktop.org/doc/dbus-specification.html

Resolves: CVE-2026-97027
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-v64f-hrwr-j4vh
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
[smcv: Added CVE ID]
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 09:44:36 +01:00
Simon McVittie d10c852a08 common: Put each bubblewrap child process in its own process group
This prevents sandboxed processes from being able to kill processes
outside the sandbox with `kill (0, SIGNAL)`. The only process they can
kill like this will be the `bwrap` supervisor, which just terminates
the sandbox when killed.

Resolves: CVE-2026-97029
Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-f3p8-vr7v-gxf2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 09:44:36 +01:00
Simon McVittie 51585ec93b NEWS: Summarize 1.19.x changes to date
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-28 09:30:07 +01:00
Kolja Lampe ddcd5c4ebb docs: Correct build var layout and persistence
Describe the default var/tmp directory and var/run symlink created by
build-init. Document that build persists var/lib and var/tmp instead of
mounting the entire var directory.
2026-09-25 16:34:21 +00:00
Razze dcfc1368fe tests: Cover document export reply formats
Exercise existing files, directories and nonexistent files against a real
document portal on the private test bus. Verify that --noexist returns a
usable export after the origin is created and preserves its read grant.

The regression fails on the AddNamed reply type mismatch without the fix.
All four checks pass with it.
2026-09-25 11:56:15 +00:00
Razze 09d787cf0d document-export: Parse the AddNamed reply for --noexist
With --noexist, the opened file descriptor refers to the parent directory.
The request correctly uses AddNamed, but is_directory makes the reply
parser expect AddFull's array reply instead of AddNamed's single string.
This produces a GVariant type mismatch and crashes the command.

Only select the AddFull reply parser for directory exports without
--noexist, matching the method used for the request.
2026-09-25 11:56:15 +00:00
Roy-Magne Mo 491294f041 po: Add Norwegian Nynorsk translation 2026-09-24 12:04:55 +00:00
Kolja Lampe 5f19424bd6 run: Forward documents using the sandbox mount path
The document portal is mounted at /run/flatpak/doc inside the sandbox,
but forwarded arguments used its host mount path. With a nonstandard
host runtime directory, that path is inaccessible to the application.

Keep the host path local to mount setup and return the sandbox destination
to argument forwarding. Preserve NULL when the portal is unavailable.

Add real-portal regression tests for user and isolated system installs.
Check file read/write, escaped URIs, directories and passthrough controls.
Skip the directory subtest on portal interfaces older than version 4.
2026-09-24 12:04:14 +00:00
Simon McVittie e38a25dbc0 subprojects: Update xdg-dbus-proxy to 0.1.9
This version addresses CVE-2026-94422, which is a sandbox escape for
Flatpak apps.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-23 14:52:31 +00:00
Razze dec343a0ea user-data: Expose app data deletion in libflatpak
Applications using libflatpak currently have to duplicate the CLI's
private cleanup logic to offer the equivalent of uninstall --delete-data.

Add a standalone API that removes ~/.var/app data and resets permission
store entries without requiring the app to be installed. Keep it separate
from transactions so callers can retry partial failures or reset data for
an installed app.

Validate app IDs before constructing paths, propagate cancellation and
permission table errors, and document partial failure behavior.
2026-09-23 09:28:18 +00:00
Kolja Lampe d7fc1e352e permission: Remove unused permission store argument
Permission table discovery reads the on-disk database directory and does
not use the D-Bus permission store proxy. Remove the unused argument and
update callers.
2026-09-23 09:28:18 +00:00
Kolja Lampe 1b4a7a0750 permission: Automatically free permission table lists
Use GLib's automatic string-vector cleanup for permission table lists.
This makes ownership explicit and ensures early returns release the list.
2026-09-23 09:28:18 +00:00
Razze c4d953f088 user-data: Simplify delete result handling
Return the permission reset result directly after app data removal. This
keeps the success and error paths equivalent while removing an unnecessary
conditional.
2026-09-23 09:28:18 +00:00
Razze baf3d2f61c user-data: Move cleanup helpers into common
Libflatpak needs to reuse user-data deletion and permission reset logic
that was previously private to the command-line builtins. This will let
software stores offer the equivalent of uninstall --delete-data.

Move each concern into a separate common module without changing behavior
so a public API can be added in a later commit. Name the user-data module
and its helper consistently here, and keep them distinct from the
existing appdata metadata code.
2026-09-23 09:28:18 +00:00
liweinan da78476438 transaction, remote-info: Include extra-data in download size estimate
flatpak update --commit and flatpak remote-info read the download size
from xa.download-size in the commit metadata, which only covers the
ostree file objects and not extra-data. The summary cache path used by
a regular flatpak update does add extra-data sizes, so the two differed:
extra-data apps like com.jetbrains.Rider showed 1.3 MB instead of 1.6 GB.

Add flatpak_commit_add_extra_data_sizes() to sum the extra-data sizes
from a commit variant, and use it in resolve_op_from_commit() and
remote-info so they match the summary path. The existing
flatpak_repo_collect_extra_data_sizes() is changed to reuse it.

Fixes: https://github.com/flatpak/flatpak/issues/5947
2026-09-22 10:23:32 +00:00
liweinan 9c9c9d302c table-printer: Fix left boundary check in comma-unique cell dedup
In flatpak_table_printer_append_cell_with_comma_unique, the duplicate
check only verified the right boundary (match[len] == 0 or comma).
This caused false positives: searching for "all" in "superall" matched
because the character after "all" happened to be a comma, even though
"all" was a substring of "superall", not a separate comma-delimited
entry.

Calculate the position of each match via pointer arithmetic
(match - cell->text) and use cell->text[pos - 1] to check the left
boundary, so that a match is only treated as duplicate when it is at
the start of the cell or preceded by a comma.
2026-09-22 10:21:47 +00:00
liweinan 1088efa00b appdata: Fix sscanf format mismatch for date parsing
The variables d, m, y are declared as 'int', but the format string
used '%u' which expects 'unsigned int *'. Change to '%d' to match
the actual argument type.

Detected by GCC -Wformat when building with warning_level=3.
2026-09-22 10:21:15 +00:00
liweinan ca63290fea remote-info, remote-ls: Refresh AppStream cache before showing data
flatpak remote-info and remote-ls --updates load version information
from a locally cached AppStream XML file that only gets refreshed during
'flatpak update'. This causes remote-info to show stale version numbers
when a new version has been published.

Fix this by calling update_appstream() before loading cached AppStream
data, unless --cached is specified. Use FLATPAK_APPSTREAM_TTL (1 day)
to avoid re-downloading on every invocation.

Closes: #5974
Signed-off-by: liweinan <liweinan@kylinos.cn>
2026-09-22 10:20:25 +00:00
Martin ed2641b9b5 po: Update Slovenian translation 2026-09-21 20:36:28 +00:00
Razze 5a37cab4b5 remote: Fix redirect option spelling and boolean flags
remote-add registers --no-follow_redirect instead of the documented
--no-follow-redirect. Its reversed flag and both remote-modify redirect
flags set initially false booleans to false, so the policy is not applied.

Correct the option spelling and remove G_OPTION_FLAG_REVERSE so these
switches enable the corresponding configuration updates.
2026-09-21 17:56:08 +00:00
liweinan 1191ac03a0 doc: Fix broken arg choice attribute in install manpage
The LOCATION arg's choice attribute value was "plan>" instead of
"plain" — a stray ">" was glued onto the value, breaking the DocBook
XML element. The same arg on the line above already used "plain"
correctly; this makes the two occurrences consistent.
2026-09-21 17:56:03 +00:00
Simon McVittie 0142e9fedb Update NEWS with 1.19.1 changes so far
I intentionally didn't mention #6818 here, because that regressed
after 1.19.0 and then was fixed before 1.19.1, so there was no release
from this branch that had the bug.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-21 17:00:06 +00:00
Razze 95b70b71e3 transaction: Release bundle GPG data as GBytes
BundleData retains explicit GPG key data with g_bytes_ref(), but its
cleanup treats the data as a GObject. This crashes transaction cleanup
when a bundle is installed with explicit key bytes.

Use g_clear_pointer() with g_bytes_unref() to release the retained data.
2026-09-21 15:53:57 +00:00
Kolja Lampe db7830e049 completion: Validate cursor position
Parse the cursor as a long before narrowing it to the completion
structure's integer field. This lets malformed, negative, and overflowing
positions fail before they can index outside the command-line buffer, while
preserving the existing behavior of clamping positive positions beyond the
line length.
2026-09-21 15:18:35 +00:00
Ekaterine Papava def3e60498 po: Update Georgian translation 2026-09-21 15:13:52 +00:00
luming zh 95c1b1374d po: Update Chinese (China) translation 2026-09-21 11:20:03 +00:00
Simon McVittie a1bcecfc6c Update libglnx subproject to 2026-09-18
libglnx v2017.2-255-g2ed30d8

* chase: Pass NO_AUTOMOUNT to chase_open_tree in shortcut path
* chase: Fix incorrect comment
* build: Suppress `-Wmissing-field-initializers`
* fdio: Don't change ownership of symlinks if not requested
  (Resolves: https://github.com/flatpak/flatpak-builder/issues/770)
* fdio: Don't try to use fd-relative operations to set symlink xattrs
  (Resolves: https://github.com/flatpak/flatpak/issues/6818)

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-09-18 16:55:49 +00:00
Bruno b4d57ffdce list: Add --bytes for sizes in bytes
g_format_size() output is unit-suffixed and locale-dependent, which
makes it awkward to sort or parse in scripts.

-b/--bytes prints a plain byte count; human-readable remains the
default. Also update the man page, the completion test and the tests.
2026-09-18 15:48:49 +00:00
Ekaterine Papava 01909035ce po: Update Georgian translation 2026-09-18 15:41:55 +00:00
abhinavmir 7c764d2984 context: Emit valid option names for D-Bus name policies
flatpak_context_to_args() built the D-Bus name options from
flatpak_policy_to_string(). That function gives the values used in the
[Session Bus Policy] and [System Bus Policy] metadata groups. Two of
them, "none" and "see", are not command-line options. A context that
contained such a policy gave --none-name= and --system-none-name=.

flatpak-run(1) writes these arguments to the [Instance] extra-args of
/.flatpak-info. flatpak-portal gives them back to flatpak(1) when a
sandboxed app calls flatpak-spawn(1). flatpak(1) then rejected the whole
command line with "Unknown option --none-name=...", so --no-talk-name
and --system-no-talk-name broke flatpak-spawn(1).

Map each policy to the option that sets it: --no-talk-name for
FLATPAK_POLICY_NONE, --talk-name for FLATPAK_POLICY_TALK, and --own-name
for FLATPAK_POLICY_OWN. FLATPAK_POLICY_SEE has no command-line option,
so emit nothing for it. It cannot occur here: the only caller serializes
a context that comes from the command line.
2026-09-18 14:47:43 +00:00