Flatpak sandbox escape via spawn portal
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- 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. A bug was discovered in the `flatpak-portal` service that can allow sandboxed applications to execute arbitrary code on the host system (a sandbox escape). This sandbox-escape bug is present in versions from 0.11.4 and before fixed versions 1.8.5 and 1.10.0. The Flatpak portal D-Bus service (`flatpak-portal`, also known by its D-Bus service name `org.freedesktop.portal.Flatpak`) allows apps in a Flatpak sandbox to launch their own subprocesses in a new sandbox instance, either with the same security settings as the caller or with more restrictive security settings. For example, this is used in Flatpak-packaged web browsers such as Chromium to launch subprocesses that will process untrusted web content, and give those subprocesses a more restrictive sandbox than the browser itself. In vulnerable versions, the Flatpak portal service passes caller-specified environment variables to non-sandboxed processes on the host system, and in particular to the `flatpak run` command that is used to launch the new sandbox instance. A malicious or compromised Flatpak app could set environment variables that are trusted by the `flatpak run` command, and use them to execute arbitrary code that is not in a sandbox. As a workaround, this vulnerability can be mitigated by preventing the `flatpak-portal` service from starting, but that mitigation will prevent many Flatpak apps from working correctly. This is fixed in versions 1.8.5 and 1.10.0.
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.11.4 to before 1.8.5; 1.9.0 to before 1.10.0 | 1.8.5, 1.10.0 | Patch available | CNA |
- flatpak Vendorflatpak Affected 0.11.4 to before 1.8.5; 1.9.0 to before 1.10.0 Fixed in 1.8.5, 1.10.0 Patch available CNA
Remediation
- Fix · CNA flatpak (flatpak) Fixed in 1.8.5, 1.10.0
Red Hat 4 advisories
- RHSA-2021:0411 Released 2021-02-04 · Red Hat rating Importantflatpak security update
- Red Hat Enterprise Linux Client (v. 7) flatpak-1.0.9-10.el7_9, flatpak-libs-1.0.9-10.el7_9
- Red Hat Enterprise Linux Client Optional (v. 7) flatpak-builder-1.0.0-10.el7_9, flatpak-devel-1.0.9-10.el7_9
- Red Hat Enterprise Linux ComputeNode Optional (v. 7) flatpak-1.0.9-10.el7_9, flatpak-builder-1.0.0-10.el7_9, flatpak-devel-1.0.9-10.el7_9 +1
- Red Hat Enterprise Linux Server (v. 7) flatpak-1.0.9-10.el7_9, flatpak-libs-1.0.9-10.el7_9
- Red Hat Enterprise Linux Server Optional (v. 7) flatpak-builder-1.0.0-10.el7_9, flatpak-devel-1.0.9-10.el7_9
- Red Hat Enterprise Linux Workstation (v. 7) flatpak-1.0.9-10.el7_9, flatpak-libs-1.0.9-10.el7_9
- Red Hat Enterprise Linux Workstation Optional (v. 7) flatpak-builder-1.0.0-10.el7_9, flatpak-devel-1.0.9-10.el7_9
- RHSA-2021:0307 Released 2021-02-01 · Red Hat rating Importantflatpak security update
- Red Hat Enterprise Linux AppStream EUS (v. 8.2) flatpak-1.6.2-4.el8_2, flatpak-libs-1.6.2-4.el8_2, flatpak-selinux-1.6.2-4.el8_2 +1
- RHSA-2021:0306 Released 2021-02-01 · Red Hat rating Importantflatpak security update
- Red Hat Enterprise Linux AppStream EUS (v. 8.1) flatpak-1.0.9-3.el8_1, flatpak-libs-1.0.9-3.el8_1
Show 1 more Red Hat advisories
- RHSA-2021:0304 Released 2021-02-01 · Red Hat rating Importantflatpak security update
- Red Hat Enterprise Linux AppStream (v. 8) flatpak-1.6.2-5.el8_3, flatpak-libs-1.6.2-5.el8_3, flatpak-selinux-1.6.2-5.el8_3 +1
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:0304 |
| Red Hat Enterprise Linux AppStream EUS (v. 8.1) | Fixed | RHSA-2021:0306 |
| Red Hat Enterprise Linux AppStream EUS (v. 8.2) | Fixed | RHSA-2021:0307 |
| Red Hat Enterprise Linux Client (v. 7) | Fixed | RHSA-2021:0411 |
| Red Hat Enterprise Linux Client Optional (v. 7) | Fixed | RHSA-2021:0411 |
| Red Hat Enterprise Linux ComputeNode Optional (v. 7) | Fixed | RHSA-2021:0411 |
| Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2021:0411 |
| Red Hat Enterprise Linux Server Optional (v. 7) | Fixed | RHSA-2021:0411 |
| Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2021:0411 |
| Red Hat Enterprise Linux Workstation Optional (v. 7) | Fixed | RHSA-2021:0411 |
Not affected: 1 product
- Red Hat Enterprise Linux 9
Timeline
- 2026-10-02 Threatist record created from CVE-2021-21261
References
Patch 3
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-21261 · CVE Program
- CVE-2021-21261 · NVD
- FIRST EPSS
- CVE-2021-21261 · 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