CVE-2021-21381
Sandbox escape via special tokens in .desktop file
Mitigation
- Upgrade flatpak to 1.10.2 or later.
Who should check
- Anyone running flatpak >= 0.9.4, < 1.10.2
Vulnerability facts
- Affected
- flatpak >= 0.9.4, < 1.10.2
- Fixed in
- flatpak 1.10.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.1 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: None
- User interaction: Required
- Scope: Changed (impact reaches other components)
- Confidentiality impact: Low
- Integrity impact: High
- Availability impact: None
- EPSS
- 1.55% chance of exploitation in 30 days (percentile 75, 2026-11-26)
- CWE
- CWE-74
- Modified
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 and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| flatpak | >= 0.9.4, < 1.10.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-21381. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-21381.md Affected: flatpak >= 0.9.4, < 1.10.2 Fixed in: flatpak 1.10.2 Steps: 1. Search this machine and project for flatpak: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://github.com/flatpak/flatpak/security/advisories/GHSA-xgh4-387p-hqpp
- https://www.debian.org/security/2021/dsa-4868
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WXNVFOIB6ZP4DGOVKAM25T6OIEP3YLGV/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2MXXLXC2DPJ45HSMTI5MZYHMYEGQN6AA/
- https://security.gentoo.org/glsa/202312-12
Patches
FAQ
Is CVE-2021-21381 being exploited?
There is no confirmed exploitation: CVE-2021-21381 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.55% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-21381?
High: CVSS 7.1 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2021-21381?
flatpak >= 0.9.4, < 1.10.2.
Is there a fix for CVE-2021-21381?
Yes. Fixed in flatpak 1.10.2. Upgrade flatpak to 1.10.2 or later.
How do I check if I'm affected by CVE-2021-21381?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.