Skip to content
Fencer Intel
high 7.1

CVE-2021-21381 json

Sandbox escape via special tokens in .desktop file

published 5y ago modified 4mo ago also EUVD-2021-8687

cvss
7.1
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.5%
EPSS 1.5% chance of exploitation in 30 days, percentile 75%
public exploits
0
none known

Summary

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

Patch / fix

  • flatpak flatpak 1.10.2
  • flatpak Debian 14, Debian 13, Debian 12 1.10.1-4

debian advisories DEBIAN-CVE-2021-21381

  • flatpak Ubuntu 18.04 LTS 1.0.9-0ubuntu0.3
  • flatpak Ubuntu 20.04 LTS 1.6.5-0ubuntu0.3

ubuntu advisories UBUNTU-CVE-2021-21381

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • flatpak RHEL 8 1.6.2-6.el8_3
  • flatpak-libs RHEL 8 1.6.2-6.el8_3
  • flatpak-selinux RHEL 8 1.6.2-6.el8_3
  • flatpak-session-helper RHEL 8 1.6.2-6.el8_3
  • flatpak RHEL 7 1.0.9-11.el7_9
  • flatpak-libs RHEL 7 1.0.9-11.el7_9
  • flatpak-builder RHEL 7 1.0.0-11.el7_9
  • flatpak RHEL 8.1 EUS 1.0.9-4.el8_1

red hat advisories RHSA-2021:1074RHSA-2021:1068RHSA-2021:1073RHSA-2021:1002

  • flatpak SLES for SAP 15 SP1, SLES 15 SP1-LTSS, SLES 15 SP1-BCL +3 more 1.2.3-150100.4.5.2

suse advisories SUSE-SU-2022:2990-1

  • flatpak Arch Linux 1.10.2-1

arch linux advisories AVG-1678

Is CVE-2021-21381 in your stack? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-21381 updated cvss 8.1

flatpak: "file forwarding" feature can be used to gain unprivileged access to files

  • Red Hat Enterprise Linux AppStream (v. 8) flatpak 1.6.2-6.el8_3, flatpak-libs 1.6.2-6.el8_3, flatpak-selinux 1.6.2-6.el8_3, flatpak-session-helper 1.6.2-6.el8_3
    fixed: vendor fix RHSA-2021:1068
  • Red Hat Enterprise Linux AppStream EUS (v. 8.1) flatpak 1.0.9-4.el8_1, flatpak-libs 1.0.9-4.el8_1
    fixed: vendor fix RHSA-2021:1074
  • Red Hat Enterprise Linux AppStream EUS (v. 8.2) flatpak 1.6.2-5.el8_2, flatpak-libs 1.6.2-5.el8_2, flatpak-selinux 1.6.2-5.el8_2, flatpak-session-helper 1.6.2-5.el8_2
    fixed: vendor fix RHSA-2021:1073
  • Red Hat Enterprise Linux Client (v. 7) flatpak 1.0.9-11.el7_9, flatpak-libs 1.0.9-11.el7_9, flatpak-builder 1.0.0-11.el7_9 Red Hat Enterprise Linux Client Optional (v. 7) flatpak 1.0.9-11.el7_9, flatpak-libs 1.0.9-11.el7_9, flatpak-builder 1.0.0-11.el7_9 Red Hat Enterprise Linux ComputeNode Optional (v. 7) flatpak 1.0.9-11.el7_9, flatpak-libs 1.0.9-11.el7_9, flatpak-builder 1.0.0-11.el7_9 Red Hat Enterprise Linux Server (v. 7) flatpak 1.0.9-11.el7_9, flatpak-libs 1.0.9-11.el7_9, flatpak-builder 1.0.0-11.el7_9 Red Hat Enterprise Linux Server Optional (v. 7) flatpak 1.0.9-11.el7_9, flatpak-libs 1.0.9-11.el7_9, flatpak-builder 1.0.0-11.el7_9 Red Hat Enterprise Linux Workstation (v. 7) flatpak 1.0.9-11.el7_9, flatpak-libs 1.0.9-11.el7_9, flatpak-builder 1.0.0-11.el7_9
    +1 more products
    Red Hat Enterprise Linux Workstation Optional (v. 7) flatpak 1.0.9-11.el7_9, flatpak-libs 1.0.9-11.el7_9, flatpak-builder 1.0.0-11.el7_9
    fixed: vendor fix RHSA-2021:1002
  • Red Hat Enterprise Linux 9 flatpak, flatpak-libs, flatpak-selinux, flatpak-session-helper
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

1.55% chance of exploitation in the next 30 days, higher than 75% of all scored CVEs (FIRST EPSS, 2026-11-09).

CVSS scores

assigned by version score vector
CNA 3.1 7.1 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N
NVD 3.1 8.2 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
NVD 2.0 5.8 AV:N/AC:M/Au:N/C:P/I:P/A:N

Affected products

  • flatpak flatpak

Classification

Weakness
  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.