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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 1.55% (percentile 75, 2026-11-28)
- **CWE:** CWE-74
- **Published:** 2021-03-11T00:00:00.000Z
- **Modified:** 2026-06-17T03:35:27.157Z

## Who should check

- Anyone running flatpak \>= 0.9.4, \< 1.10.2

## 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

- flatpak: \>= 0.9.4, \< 1.10.2 (cvelist)

## Mitigation

- Upgrade flatpak to 1.10.2 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

## 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-28).

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

## References

- vendor: <https://github.com/flatpak/flatpak/security/advisories/GHSA-xgh4-387p-hqpp>
- vendor: <https://www.debian.org/security/2021/dsa-4868>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WXNVFOIB6ZP4DGOVKAM25T6OIEP3YLGV/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2MXXLXC2DPJ45HSMTI5MZYHMYEGQN6AA/>
- vendor: <https://security.gentoo.org/glsa/202312-12>
- patch: <https://github.com/flatpak/flatpak/pull/4156>
- patch: <https://github.com/flatpak/flatpak/commit/8279c5818425b6812523e3805bbe242fb6a5d961>
- patch: <https://github.com/flatpak/flatpak/commit/a7401e638bf0c03102039e216ab1081922f140ae>
- patch: <https://github.com/flatpak/flatpak/commit/eb7946bb6248923d8c90fe9b84425fef97ae580d>
- other: <https://github.com/flatpak/flatpak/releases/tag/1.10.2>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-21381>

HTML: <https://flawdb.com/CVE-2021-21381> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-21381>
