CVEfocus › CVE database › CVE-2021-21381

CVE-2021-21381Sandbox escape via special tokens in .desktop file

CVSS 7.1 HighEPSS 1.5% (higher than 75% of CVEs)Published 2021-03-11Updated 2024-08-03Assigner: GitHub_M

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`.

CWE-74

What to do

Fixed builds are available from Debian, Red Hat, Ubuntu: see the table below for the fixed version per release.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

13Fixed
5Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 20.04flatpakFixed1.6.5-0ubuntu0.3UBUNTU-CVE-2021-21381
Ubuntu 18.04flatpakFixed1.0.9-0ubuntu0.3UBUNTU-CVE-2021-21381
Debian 14flatpakFixed1.10.1-4DEBIAN-CVE-2021-21381
Debian 13flatpakFixed1.10.1-4DEBIAN-CVE-2021-21381
Debian 12flatpakFixed1.10.1-4DEBIAN-CVE-2021-21381
Red Hat Enterprise Linux 9flatpakNot affected
Red Hat Enterprise Linux 9flatpak-develNot affected
Red Hat Enterprise Linux 9flatpak-libsNot affected
Red Hat Enterprise Linux 9flatpak-selinuxNot affected
Red Hat Enterprise Linux 9flatpak-session-helperNot affected
Red Hat Enterprise Linux 8flatpakFixed0:1.6.2-6.el8_3RHSA-2021:1068
Red Hat Enterprise Linux 8flatpak-libsFixed0:1.6.2-6.el8_3RHSA-2021:1068
Red Hat Enterprise Linux 8flatpak-selinuxFixed0:1.6.2-6.el8_3RHSA-2021:1068
Red Hat Enterprise Linux 8flatpak-session-helperFixed0:1.6.2-6.el8_3RHSA-2021:1068
Red Hat Enterprise Linux 7flatpakFixed0:1.0.9-11.el7_9RHSA-2021:1002
Red Hat Enterprise Linux 7flatpak-builderFixed0:1.0.0-11.el7_9RHSA-2021:1002
Red Hat Enterprise Linux 7flatpak-develFixed0:1.0.9-11.el7_9RHSA-2021:1002
Red Hat Enterprise Linux 7flatpak-libsFixed0:1.0.9-11.el7_9RHSA-2021:1002

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.