Skip to content
OpenAdvisories
High · 7.1 CVE-2021-21381 EUVD-2021-8687

Sandbox escape via special tokens in .desktop file

Published Mar 11, 2021 · Updated Aug 3, 2024 · Assigned by GitHub_M

Description

Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux. In Flatpack since version 0.9.4 and before version 1.10.2 has a vulnerability in the "file forwarding" feature which can be used by an attacker to gain access to files that would not ordinarily be allowed by the app's permissions. By putting the special tokens `@@` and/or `@@u` in the Exec field of a Flatpak app's .desktop file, a malicious app publisher can trick flatpak into behaving as though the user had chosen to open a target file with their Flatpak app, which automatically makes that file available to the Flatpak app. This is fixed in version 1.10.2. A minimal solution is the first commit "`Disallow @@ and @@U usage in desktop files`". The follow-up commits "`dir: Reserve the whole @@ prefix`" and "`dir: Refuse to export .desktop files with suspicious uses of @@ tokens`" are recommended, but not strictly required. As a workaround, avoid installing Flatpak apps from untrusted sources, or check the contents of the exported `.desktop` files in `exports/share/applications/*.desktop` (typically `~/.local/share/flatpak/exports/share/applications/*.desktop` and `/var/lib/flatpak/exports/share/applications/*.desktop`) to make sure that literal filenames do not follow `@@` or `@@u`.

Affected products

VendorProductAffectedFixed
flatpak flatpak >= 0.9.4, < 1.10.2 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 flatpak 1.10.1-4 —
Debian 13 flatpak 1.10.1-4 —
Debian 12 flatpak 1.10.1-4 —
Debian 10 flatpak 1.2.5-0+deb10u4 DSA-4868-1
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS flatpak 1.6.5-0ubuntu0.3 USN-4951-1
Ubuntu 18.04 LTS flatpak 1.0.9-0ubuntu0.3 USN-4951-1
ReleasePackageFixed inAdvisory
RHEL 8 flatpak +3 1.6.2-6.el8_3 RHSA-2021:1068
RHEL 7 flatpak +2 1.0.9-11.el7_9 RHSA-2021:1002
RHEL 7 flatpak-builder 1.0.0-11.el7_9 RHSA-2021:1002
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
RHEL 8.2 EUS flatpak +3 1.6.2-5.el8_2 RHSA-2021:1073
RHEL 8.1 EUS flatpak +1 1.0.9-4.el8_1 RHSA-2021:1074
ReleasePackageFixed inAdvisory
SLES 15 SP1 flatpak 1.2.3-150100.4.5.2 SUSE-SU-2022:2990-1
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP1 flatpak 1.2.3-150100.4.5.2 SUSE-SU-2022:2990-1
SLE HPC 15 SP1 flatpak 1.2.3-150100.4.5.2 SUSE-SU-2022:2990-1
SUSE Enterprise Storage 6 flatpak 1.2.3-150100.4.5.2 SUSE-SU-2022:2990-1

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2 flatpak +2 1.0.9-10.amzn2.0.1 ALAS2-2021-1625
Amazon Linux 2 flatpak-builder 1.0.0-10.amzn2.0.1 ALAS2-2021-1625

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 8 flatpak +3 1.6.2-6.el8_3 ELSA-2021-1068
Oracle Linux 7 flatpak +2 1.0.9-11.el7_9 ELSA-2021-1002
Oracle Linux 7 flatpak-builder 1.0.0-11.el7_9 ELSA-2021-1002

Advisories 10

References