Bug 1917430 (CVE-2021-21261) - CVE-2021-21261 flatpak: sandbox escape via spawn portal
Summary: CVE-2021-21261 flatpak: sandbox escape via spawn portal
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2021-21261
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1917431 1917432 1918771 1918772 1918773 1918774 1918776
Blocks: 1918334
TreeView+ depends on / blocked
 
Reported: 2021-01-18 13:34 UTC by Michael Kaplan
Modified: 2022-05-17 10:26 UTC (History)
3 users (show)

Fixed In Version: flatpak 1.8.5, flatpak 1.10.0
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in Flatpak. The Flatpak portal D-Bus 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 outside the sandbox. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.
Clone Of:
Environment:
Last Closed: 2021-02-01 14:41:47 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:0304 0 None None None 2021-02-01 09:13:35 UTC
Red Hat Product Errata RHSA-2021:0306 0 None None None 2021-02-01 10:16:14 UTC
Red Hat Product Errata RHSA-2021:0307 0 None None None 2021-02-01 10:35:35 UTC
Red Hat Product Errata RHSA-2021:0411 0 None None None 2021-02-04 11:09:50 UTC

Description Michael Kaplan 2021-01-18 13:34:55 UTC
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.

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.

Comment 2 Michael Kaplan 2021-01-18 13:35:18 UTC
Created flatpak tracking bugs for this issue:

Affects: fedora-all [bug 1917431]

Comment 3 Michael Kaplan 2021-01-18 13:35:20 UTC
External References:

https://github.com/flatpak/flatpak/security/advisories/GHSA-4ppf-fxf6-vxg2

Comment 7 Mauro Matteo Cascella 2021-01-22 10:22:07 UTC
Mitigation:

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.

Comment 8 Mauro Matteo Cascella 2021-01-27 13:37:21 UTC
Note from upstream advisory (comment 3): The initial fixes introduced a regression (#4080) for users of a setuid version of bubblewrap (bwrap). This is fixed in 1.10.1 (commits 9a61d2c [1] and fb473ca [2], also backported to the flatpak-1.8.x branch).

[1] https://github.com/flatpak/flatpak/commit/9a61d2c44f0a58cebcb9b2787ae88db07ca68bb0
[2] https://github.com/flatpak/flatpak/commit/fb473cad801c6b61706353256cab32330557374a

Comment 9 Mauro Matteo Cascella 2021-01-28 21:01:08 UTC
Acknowledgments:

Name: Simon McVittie (Collabora Ltd.)

Comment 11 errata-xmlrpc 2021-02-01 09:13:31 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:0304 https://access.redhat.com/errata/RHSA-2021:0304

Comment 12 errata-xmlrpc 2021-02-01 10:16:12 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.1 Extended Update Support

Via RHSA-2021:0306 https://access.redhat.com/errata/RHSA-2021:0306

Comment 13 errata-xmlrpc 2021-02-01 10:35:33 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.2 Extended Update Support

Via RHSA-2021:0307 https://access.redhat.com/errata/RHSA-2021:0307

Comment 14 Product Security DevOps Team 2021-02-01 14:41:47 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2021-21261

Comment 15 errata-xmlrpc 2021-02-04 11:09:46 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2021:0411 https://access.redhat.com/errata/RHSA-2021:0411


Note You need to log in before you can comment on or make changes to this bug.