Sandbox escape via special tokens in .desktop file
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and Red Hat.
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`.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| flatpak | flatpak | 0.9.4 to before 1.10.2 | 1.10.2 | Patch available | CNA |
- flatpak Vendorflatpak Affected 0.9.4 to before 1.10.2 Fixed in 1.10.2 Patch available CNA
CPE configurations NVD · 4
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:flatpak:flatpak:*:*:*:*:*:*:*:* | 0.9.4 to before 1.10.2 | Vulnerable | flatpak |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
| cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* | 33 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* | 34 | Vulnerable | Fedoraproject |
- cpe:2.3:a:flatpak:flatpak:*:*:*:*:*:*:*:* Versions 0.9.4 to before 1.10.2 Vulnerable ·flatpak
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
- cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* Versions 33 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject
Remediation
- Fix · CNA flatpak (flatpak) Fixed in 1.10.2
Red Hat 4 advisories
- RHSA-2021:1068 Released 2021-04-06 · Red Hat rating Importantflatpak security update
- 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 +1
- RHSA-2021:1073 Released 2021-04-06 · Red Hat rating Importantflatpak security update
- 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 +1
- RHSA-2021:1074 Released 2021-04-06 · Red Hat rating Importantflatpak security update
- Red Hat Enterprise Linux AppStream EUS (v. 8.1) flatpak-1.0.9-4.el8_1, flatpak-libs-1.0.9-4.el8_1
Show 1 more Red Hat advisories
- RHSA-2021:1002 Released 2021-03-29 · Red Hat rating Importantflatpak security update
- Red Hat Enterprise Linux Client (v. 7) flatpak-1.0.9-11.el7_9, flatpak-libs-1.0.9-11.el7_9
- Red Hat Enterprise Linux Client Optional (v. 7) flatpak-builder-1.0.0-11.el7_9, flatpak-devel-1.0.9-11.el7_9
- Red Hat Enterprise Linux ComputeNode Optional (v. 7) flatpak-1.0.9-11.el7_9, flatpak-builder-1.0.0-11.el7_9, flatpak-devel-1.0.9-11.el7_9 +1
- Red Hat Enterprise Linux Server (v. 7) flatpak-1.0.9-11.el7_9, flatpak-libs-1.0.9-11.el7_9
- Red Hat Enterprise Linux Server Optional (v. 7) flatpak-builder-1.0.0-11.el7_9, flatpak-devel-1.0.9-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
- Red Hat Enterprise Linux Workstation Optional (v. 7) flatpak-builder-1.0.0-11.el7_9, flatpak-devel-1.0.9-11.el7_9
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2021:1068 |
| Red Hat Enterprise Linux AppStream EUS (v. 8.1) | Fixed | RHSA-2021:1074 |
| Red Hat Enterprise Linux AppStream EUS (v. 8.2) | Fixed | RHSA-2021:1073 |
| Red Hat Enterprise Linux Client (v. 7) | Fixed | RHSA-2021:1002 |
| Red Hat Enterprise Linux Client Optional (v. 7) | Fixed | RHSA-2021:1002 |
| Red Hat Enterprise Linux ComputeNode Optional (v. 7) | Fixed | RHSA-2021:1002 |
| Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2021:1002 |
| Red Hat Enterprise Linux Server Optional (v. 7) | Fixed | RHSA-2021:1002 |
| Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2021:1002 |
| Red Hat Enterprise Linux Workstation Optional (v. 7) | Fixed | RHSA-2021:1002 |
Not affected: 1 product
- Red Hat Enterprise Linux 9
Timeline
- 2026-10-02 Threatist record created from CVE-2021-21381
References
Patch 4
More Flatpak vulnerabilities
- TI-2026-26401 Flatpak has a complete sandbox escape leading to host file access and code execution in the host context CVSS 4.0CRITICAL 9.3
- TI-2024-28440 Flatpak may allow access to files outside sandbox for certain apps CVSS 3.1CRITICAL 10.0
- TI-2023-12679 TIOCLINUX can send commands outside sandbox if running on a virtual console CVSS 3.1CRITICAL 10.0
- TI-2026-26402 Flatpak affected by arbitrary file deletion on the host filesystem CVSS 4.0HIGH 8.7
- TI-2019-07389 Flatpak before 1.0.8, 1.1.x and 1.2.x before 1.2.4, and 1.3.x before 1.3.1 allows a… CVSS 3.0CRITICAL 9.0
- TI-2021-19666 Permissions granted to applications can be hidden from the user at install time CVSS 3.1HIGH 8.6
Sources
- CVE-2021-21381 · CVE Program
- CVE-2021-21381 · NVD
- FIRST EPSS
- CVE-2021-21381 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences