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

High 8.4 Published Updated

A malicious Flatpak app can escape its sandbox and execute arbitrary code on the host by injecting bwrap arguments via the RequestBackground portal.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-32462?

CVE-2024-32462 is a high-severity command injection vulnerability in Fedoraproject Fedora, published on 18 Apr 2024. It can only be exploited from the same machine or local network, with no action from the victim.

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.

Weakness: CWE-88

Which versions are affected by CVE-2024-32462?

It affects 2 products.

Linux distribution packages (40)
flatpak AlmaLinux:8All versions1.12.9-1.el8_10
flatpak-devel AlmaLinux:8All versions1.12.9-1.el8_10
flatpak-libs AlmaLinux:8All versions1.12.9-1.el8_10
flatpak-selinux AlmaLinux:8All versions1.12.9-1.el8_10
flatpak-session-helper AlmaLinux:8All versions1.12.9-1.el8_10
flatpak AlmaLinux:9All versions1.12.9-1.el9_4
flatpak-devel AlmaLinux:9All versions1.12.9-1.el9_4
flatpak-libs AlmaLinux:9All versions1.12.9-1.el9_4
flatpak-selinux AlmaLinux:9All versions1.12.9-1.el9_4
flatpak-session-helper AlmaLinux:9All versions1.12.9-1.el9_4
flatpak Red Hat:enterprise_linux:7::clientAll versions0:1.0.9-13.el7_9
flatpak-builder Red Hat:enterprise_linux:7::clientAll versions0:1.0.0-13.el7_9
flatpak-debuginfo Red Hat:enterprise_linux:7::clientAll versions0:1.0.9-13.el7_9
flatpak-devel Red Hat:enterprise_linux:7::clientAll versions0:1.0.9-13.el7_9
flatpak-libs Red Hat:enterprise_linux:7::clientAll versions0:1.0.9-13.el7_9
flatpak Red Hat:enterprise_linux:7::computenodeAll versions0:1.0.9-13.el7_9
flatpak-builder Red Hat:enterprise_linux:7::computenodeAll versions0:1.0.0-13.el7_9
flatpak-debuginfo Red Hat:enterprise_linux:7::computenodeAll versions0:1.0.9-13.el7_9
flatpak-devel Red Hat:enterprise_linux:7::computenodeAll versions0:1.0.9-13.el7_9
flatpak-libs Red Hat:enterprise_linux:7::computenodeAll versions0:1.0.9-13.el7_9
flatpak Red Hat:enterprise_linux:7::serverAll versions0:1.0.9-13.el7_9
flatpak-builder Red Hat:enterprise_linux:7::serverAll versions0:1.0.0-13.el7_9
flatpak-debuginfo Red Hat:enterprise_linux:7::serverAll versions0:1.0.9-13.el7_9
flatpak-devel Red Hat:enterprise_linux:7::serverAll versions0:1.0.9-13.el7_9
flatpak-libs Red Hat:enterprise_linux:7::serverAll versions0:1.0.9-13.el7_9
flatpak Red Hat:enterprise_linux:7::workstationAll versions0:1.0.9-13.el7_9
flatpak-builder Red Hat:enterprise_linux:7::workstationAll versions0:1.0.0-13.el7_9
flatpak-debuginfo Red Hat:enterprise_linux:7::workstationAll versions0:1.0.9-13.el7_9
flatpak-devel Red Hat:enterprise_linux:7::workstationAll versions0:1.0.9-13.el7_9
flatpak-libs Red Hat:enterprise_linux:7::workstationAll versions0:1.0.9-13.el7_9
flatpak Red Hat:enterprise_linux:8::appstreamAll versions0:1.12.9-1.el8_10
flatpak-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.12.9-1.el8_10
flatpak-debugsource Red Hat:enterprise_linux:8::appstreamAll versions0:1.12.9-1.el8_10
flatpak-libs Red Hat:enterprise_linux:8::appstreamAll versions0:1.12.9-1.el8_10
flatpak-libs-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.12.9-1.el8_10
flatpak-selinux Red Hat:enterprise_linux:8::appstreamAll versions0:1.12.9-1.el8_10
flatpak-session-helper Red Hat:enterprise_linux:8::appstreamAll versions0:1.12.9-1.el8_10
flatpak-session-helper-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.12.9-1.el8_10
flatpak-tests-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.12.9-1.el8_10
flatpak Red Hat:enterprise_linux:8::crbAll versions0:1.12.9-1.el8_10

Products include Fedoraproject Fedora, Flatpak Flatpak.

How do I fix CVE-2024-32462?

Upgrade to a fixed version.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2024-32462 being exploited?

There is no known exploitation of CVE-2024-32462 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as ALSA-2024:3959, ALSA-2024:3961, CLEANSTART-2024-IL49391, CLSA-2025-1741215879, DEBIAN-CVE-2024-32462, DSA-5666-1 and 26 more.

Is CVE-2024-32462 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free