Vulnerability · Published Apr 18, 2024 · Assigned by GitHub_M

CVE-2024-32462Flatpak vulnerable to a sandbox escape via RequestBackground portal due to bad argument parsing

High 8.4

In plain English

A high-severity argument injection in flatpak from flatpak. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 44% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.4High
Exploit odds (30 days)0.5%top 56.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

Official description

Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux. in versions before 1.10.9, 1.12.9, 1.14.6, and 1.15.8, a malicious or compromised Flatpak app could execute arbitrary code outside its sandbox. Normally, the `--command` argument of `flatpak run` expects to be given a command to run in the specified Flatpak app, optionally along with some arguments. However it is possible to instead pass `bwrap` arguments to `--command=`, such as `--bind`. It's possible to pass an arbitrary `commandline` to the portal interface `org.freedesktop.portal.Background.RequestBackground` from within a Flatpak app. When this is converted into a `--command` and arguments, it achieves the same effect of passing arguments directly to `bwrap`, and thus can be used for a sandbox escape. The solution is to pass the `--` argument to `bwrap`, which makes it stop processing options. This has been supported since bubblewrap 0.3.0. All supported versions of Flatpak require at least that version of bubblewrap. xdg-desktop-portal version 1.18.4 will mitigate this vulnerability by only allowing Flatpak apps to create .desktop files for commands that do not start with --. The vulnerability is patched in 1.15.8, 1.10.9, 1.12.9, and 1.14.6.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8flatpak1.12.9-1.el8_10ALSA-2024:3961
AlmaLinux:9flatpak1.12.9-1.el9_4ALSA-2024:3959
AlmaLinux:8flatpak-devel1.12.9-1.el8_10ALSA-2024:3961
AlmaLinux:9flatpak-devel1.12.9-1.el9_4ALSA-2024:3959
AlmaLinux:8flatpak-libs1.12.9-1.el8_10ALSA-2024:3961
AlmaLinux:9flatpak-libs1.12.9-1.el9_4ALSA-2024:3959
AlmaLinux:8flatpak-selinux1.12.9-1.el8_10ALSA-2024:3961
AlmaLinux:9flatpak-selinux1.12.9-1.el9_4ALSA-2024:3959
AlmaLinux:8flatpak-session-helper1.12.9-1.el8_10ALSA-2024:3961
AlmaLinux:9flatpak-session-helper1.12.9-1.el9_4ALSA-2024:3959
Alpine:v3.20flatpak1.14.6-r1ALPINE-CVE-2024-32462
Alpine:v3.21flatpak1.14.6-r1ALPINE-CVE-2024-32462
Alpine:v3.22flatpak1.14.6-r1ALPINE-CVE-2024-32462
Alpine:v3.23flatpak1.14.6-r1ALPINE-CVE-2024-32462
Alpine:v3.24flatpak1.14.6-r1ALPINE-CVE-2024-32462
Debian:12flatpak1.14.4-1+deb12u1DSA-5666-1
Debian:12flatpak1.14.4-1+deb12u1DEBIAN-CVE-2024-32462
Debian:13flatpak1.14.6-1DEBIAN-CVE-2024-32462
Debian:14flatpak1.14.6-1DEBIAN-CVE-2024-32462
Rocky Linux:8flatpak0:1.12.9-1.el8_10RLSA-2024:3961
Rocky Linux:9flatpak0:1.12.9-1.el9_4RLSA-2024:3959
Ubuntu:24.04:LTSflatpak1.14.6-1UBUNTU-CVE-2024-32462

Affected products (as reported)

VendorProductVersions
flatpak flatpak < 1.10.9>= 1.12.0, < 1.12.9>= 1.14.0, < 1.14.6>= 1.15.0, < 1.15.8

Weakness: CWE-88 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N

References