CVEfocus › CVE database › CVE-2021-21261

CVE-2021-21261Flatpak sandbox escape via spawn portal

CVSS 7.3 HighEPSS 0.6% (higher than 42% of CVEs)Published 2021-01-14Updated 2024-08-03Assigner: GitHub_M

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.

CWE-74

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

25Fixed
5Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 20.04flatpakFixed1.6.5-0ubuntu0.2UBUNTU-CVE-2021-21261
Ubuntu 18.04flatpakFixed1.0.9-0ubuntu0.2UBUNTU-CVE-2021-21261
Debian 14flatpakFixed1.8.5-1DEBIAN-CVE-2021-21261
Debian 13flatpakFixed1.8.5-1DEBIAN-CVE-2021-21261
Debian 12flatpakFixed1.8.5-1DEBIAN-CVE-2021-21261
Red Hat Enterprise Linux 9flatpakNot affected
Red Hat Enterprise Linux 9flatpak-develNot affected
Red Hat Enterprise Linux 9flatpak-libsNot affected
Red Hat Enterprise Linux 9flatpak-selinuxNot affected
Red Hat Enterprise Linux 9flatpak-session-helperNot affected
Red Hat Enterprise Linux 8flatpakFixed0:1.6.2-5.el8_3RHSA-2021:0304
Red Hat Enterprise Linux 8flatpak-libsFixed0:1.6.2-5.el8_3RHSA-2021:0304
Red Hat Enterprise Linux 8flatpak-selinuxFixed0:1.6.2-5.el8_3RHSA-2021:0304
Red Hat Enterprise Linux 8flatpak-session-helperFixed0:1.6.2-5.el8_3RHSA-2021:0304
Red Hat Enterprise Linux 7flatpakFixed0:1.0.9-10.el7_9RHSA-2021:0411
Red Hat Enterprise Linux 7flatpak-builderFixed0:1.0.0-10.el7_9RHSA-2021:0411
Red Hat Enterprise Linux 7flatpak-develFixed0:1.0.9-10.el7_9RHSA-2021:0411
Red Hat Enterprise Linux 7flatpak-libsFixed0:1.0.9-10.el7_9RHSA-2021:0411
Alpine Linux 3.24flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.23flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.22flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.21flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.20flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.19flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.18flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.17flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.16flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.15flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.14flatpakFixed1.10.1-r0ALPINE-CVE-2021-21261
Alpine Linux 3.13flatpakFixed1.10.1-r0ALPINE-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.

Vendor advisories:

References

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.