CVE-2021-21261Flatpak sandbox escape via spawn portal
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.
What to do
Fixed builds are available from Alpine, Debian, Red Hat, Ubuntu: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 20.04 | flatpak | Fixed | 1.6.5-0ubuntu0.2 | UBUNTU-CVE-2021-21261 |
| Ubuntu 18.04 | flatpak | Fixed | 1.0.9-0ubuntu0.2 | UBUNTU-CVE-2021-21261 |
| Debian 14 | flatpak | Fixed | 1.8.5-1 | DEBIAN-CVE-2021-21261 |
| Debian 13 | flatpak | Fixed | 1.8.5-1 | DEBIAN-CVE-2021-21261 |
| Debian 12 | flatpak | Fixed | 1.8.5-1 | DEBIAN-CVE-2021-21261 |
| Red Hat Enterprise Linux 9 | flatpak | Not affected | ||
| Red Hat Enterprise Linux 9 | flatpak-devel | Not affected | ||
| Red Hat Enterprise Linux 9 | flatpak-libs | Not affected | ||
| Red Hat Enterprise Linux 9 | flatpak-selinux | Not affected | ||
| Red Hat Enterprise Linux 9 | flatpak-session-helper | Not affected | ||
| Red Hat Enterprise Linux 8 | flatpak | Fixed | 0:1.6.2-5.el8_3 | RHSA-2021:0304 |
| Red Hat Enterprise Linux 8 | flatpak-libs | Fixed | 0:1.6.2-5.el8_3 | RHSA-2021:0304 |
| Red Hat Enterprise Linux 8 | flatpak-selinux | Fixed | 0:1.6.2-5.el8_3 | RHSA-2021:0304 |
| Red Hat Enterprise Linux 8 | flatpak-session-helper | Fixed | 0:1.6.2-5.el8_3 | RHSA-2021:0304 |
| Red Hat Enterprise Linux 7 | flatpak | Fixed | 0:1.0.9-10.el7_9 | RHSA-2021:0411 |
| Red Hat Enterprise Linux 7 | flatpak-builder | Fixed | 0:1.0.0-10.el7_9 | RHSA-2021:0411 |
| Red Hat Enterprise Linux 7 | flatpak-devel | Fixed | 0:1.0.9-10.el7_9 | RHSA-2021:0411 |
| Red Hat Enterprise Linux 7 | flatpak-libs | Fixed | 0:1.0.9-10.el7_9 | RHSA-2021:0411 |
| Alpine Linux 3.24 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.23 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.22 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.21 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.20 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.19 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.18 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.17 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.16 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.15 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.14 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
| Alpine Linux 3.13 | flatpak | Fixed | 1.10.1-r0 | ALPINE-CVE-2021-21261 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- flatpak: affected: >= 0.11.4, < 1.8.5, >= 1.9.0, < 1.10.0
Vendor advisories:
- https://www.debian.org/security/2021/dsa-4830 (vendor-advisory)
- https://security.gentoo.org/glsa/202101-21 (vendor-advisory)
References
- https://github.com/flatpak/flatpak/security/advisories/GHSA-4ppf-fxf6-vxg2
- https://github.com/flatpak/flatpak/releases/tag/1.8.5
- https://www.debian.org/security/2021/dsa-4830
- https://github.com/flatpak/flatpak/commit/6d1773d2a54dde9b099043f07a2094a4f1c2f486
- https://github.com/flatpak/flatpak/commit/6e5ae7a109cdfa9735ea7ccbd8cb79f9e8d3ae8b
- https://github.com/flatpak/flatpak/commit/aeb6a7ab0abaac4a8f4ad98b3df476d9de6b8bd4
- https://github.com/flatpak/flatpak/commit/cc1401043c075268ecc652eac557ef8076b5eaba
- https://security.gentoo.org/glsa/202101-21
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.