Skip to content
Fencer Intel
high 7.3

CVE-2021-21261 json

Flatpak sandbox escape via spawn portal

published 5y ago modified 4mo ago also EUVD-2021-8642

cvss
7.3
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.6%
EPSS 0.6% chance of exploitation in 30 days, percentile 48%
public exploits
0
none known

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.

Patch / fix

  • flatpak flatpak 1.8.5, 1.10.0
  • flatpak Debian 14, Debian 13, Debian 12 1.8.5-1

debian advisories DEBIAN-CVE-2021-21261

  • flatpak Ubuntu 18.04 LTS 1.0.9-0ubuntu0.2
  • flatpak Ubuntu 20.04 LTS 1.6.5-0ubuntu0.2

ubuntu advisories UBUNTU-CVE-2021-21261

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • flatpak RHEL 7 1.0.9-10.el7_9
  • flatpak-libs RHEL 7 1.0.9-10.el7_9
  • flatpak-builder RHEL 7 1.0.0-10.el7_9
  • flatpak RHEL 8 1.6.2-5.el8_3
  • flatpak-libs RHEL 8 1.6.2-5.el8_3
  • flatpak-selinux RHEL 8 1.6.2-5.el8_3
  • flatpak-session-helper RHEL 8 1.6.2-5.el8_3
  • flatpak RHEL 8.2 EUS 1.6.2-4.el8_2

red hat advisories RHSA-2021:0411RHSA-2021:0307RHSA-2021:0306RHSA-2021:0304

  • flatpak SLES for SAP 15 SP1, SLES 15 SP1-LTSS, SLES 15 SP1-BCL +3 more 1.2.3-150100.4.8.1
  • flatpak SLES for SAP 15 SP1, SLES 15 SP1-LTSS, SLES 15 SP1-BCL +3 more 1.2.3-150100.4.5.2
  • xdg-desktop-portal-gtk SLE Module for Desktop Applications 15 SP2 1.8.0-3.3.1
  • flatpak SLE Module for Desktop Applications 15 SP2 1.10.2-4.6.1
  • libostree SLE Module for Desktop Applications 15 SP2, SLE Module for Basesystem 15 SP2 2020.8-3.3.2
  • xdg-desktop-portal SLE Module for Desktop Applications 15 SP2 1.8.0-5.3.2

suse advisories SUSE-SU-2022:3284-1SUSE-SU-2022:2990-1SUSE-SU-2021:1094-1

  • flatpak openSUSE Tumbleweed 1.11.3-1.2
  • xdg-desktop-portal-gtk openSUSE Leap 15.2 1.8.0-lp152.2.3.1
  • flatpak openSUSE Leap 15.2 1.10.2-lp152.3.6.1
  • libostree openSUSE Leap 15.2 2020.8-lp152.2.3.1
  • xdg-desktop-portal openSUSE Leap 15.2 1.8.0-lp152.4.3.1

opensuse advisories openSUSE-SU-2024:10762-1openSUSE-SU-2021:0520-1

  • flatpak Alpine 3.24, Alpine 3.23, Alpine 3.22 +9 more 1.10.1-r0

alpine advisories ALPINE-CVE-2021-21261

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • flatpak Arch Linux 1.10.0-1

arch linux advisories AVG-1454

Is CVE-2021-21261 in your stack? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-21261 updated cvss 8.8

flatpak: sandbox escape via spawn portal

  • 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, flatpak-session-helper 1.6.2-5.el8_3
    fixed: vendor fix “This vulnerability can be mitigated by preventing the flatpak-portal service from starting. Please note that this mitigation may prevent other Flatpak apps from working correctly.” RHSA-2021:0304
  • Red Hat Enterprise Linux AppStream EUS (v. 8.1) flatpak 1.0.9-3.el8_1, flatpak-libs 1.0.9-3.el8_1
    fixed: vendor fix “This vulnerability can be mitigated by preventing the flatpak-portal service from starting. Please note that this mitigation may prevent other Flatpak apps from working correctly.” RHSA-2021:0306
  • 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, flatpak-session-helper 1.6.2-4.el8_2
    fixed: vendor fix “This vulnerability can be mitigated by preventing the flatpak-portal service from starting. Please note that this mitigation may prevent other Flatpak apps from working correctly.” RHSA-2021:0307
  • 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 Red Hat Enterprise Linux ComputeNode Optional (v. 7) flatpak 1.0.9-10.el7_9, flatpak-libs 1.0.9-10.el7_9, flatpak-builder 1.0.0-10.el7_9 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 Red Hat Enterprise Linux Workstation (v. 7) flatpak 1.0.9-10.el7_9, flatpak-libs 1.0.9-10.el7_9
    +1 more products
    Red Hat Enterprise Linux Workstation Optional (v. 7) flatpak-builder 1.0.0-10.el7_9
    fixed: vendor fix “This vulnerability can be mitigated by preventing the flatpak-portal service from starting. Please note that this mitigation may prevent other Flatpak apps from working correctly.” RHSA-2021:0411
  • Red Hat Enterprise Linux 9 flatpak, flatpak-libs, flatpak-selinux, flatpak-session-helper
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

0.60% chance of exploitation in the next 30 days, higher than 48% of all scored CVEs (FIRST EPSS, 2026-11-09).

CVSS scores

assigned by version score vector
CNA 3.1 7.3 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N
NVD 3.1 8.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
NVD 2.0 7.2 AV:L/AC:L/Au:N/C:C/I:C/A:C

Affected products

  • flatpak flatpak

Classification

Weakness
  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.