CVE-2021-43860 Permissions granted to applications can be hidden from the user at install time

High 8.2 Published Updated

Attackers can hide malicious permissions from users by exploiting null byte handling in Flatpak metadata, allowing unauthorized access to system resources.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-43860?

CVE-2021-43860 is a high-severity vulnerability in Debian Debian Linux, published on 12 Jan 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

Flatpak is a Linux application sandboxing and distribution framework. Prior to versions 1.12.3 and 1.10.6, Flatpak doesn't properly validate that the permissions displayed to the user for an app at install time match the actual permissions granted to the app at runtime, in the case that there's a null byte in the metadata file of an app. Therefore apps can grant themselves permissions without the consent of the user. Flatpak shows permissions to the user during install by reading them from the "xa.metadata" key in the commit metadata. This cannot contain a null terminator, because it is an untrusted GVariant. Flatpak compares these permissions to the *actual* metadata, from the "metadata" file to ensure it wasn't lied to. However, the actual metadata contents are loaded in several places where they are read as simple C-style strings. That means that, if the metadata file includes a null terminator, only the content of the file from *before* the terminator gets compared to xa.metadata. Thus, any permissions that appear in the metadata file after a null terminator are applied at runtime but not shown to the user. So maliciously crafted apps can give themselves hidden permissions. Users who have Flatpaks installed from untrusted sources are at risk in case the Flatpak has a maliciously crafted metadata file, either initially or in an update. This issue is patched in versions 1.12.3 and 1.10.6. As a workaround, users can manually check the permissions of installed apps by checking the metadata file or the xa.metadata key on the commit metadata.

Weakness: CWE-276, CWE-269

Which versions are affected by CVE-2021-43860?

It affects 4 products.

Linux distribution packages (24)
flatpak AlmaLinux:8All versions1.8.7-1.el8
flatpak-devel AlmaLinux:8All versions1.8.7-1.el8
flatpak-libs AlmaLinux:8All versions1.8.7-1.el8
flatpak-selinux AlmaLinux:8All versions1.8.7-1.el8
flatpak-session-helper AlmaLinux:8All versions1.8.7-1.el8
flatpak Red Hat:enterprise_linux:8::appstreamAll versions0:1.8.7-1.el8
flatpak-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.8.7-1.el8
flatpak-debugsource Red Hat:enterprise_linux:8::appstreamAll versions0:1.8.7-1.el8
flatpak-libs Red Hat:enterprise_linux:8::appstreamAll versions0:1.8.7-1.el8
flatpak-libs-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.8.7-1.el8
flatpak-selinux Red Hat:enterprise_linux:8::appstreamAll versions0:1.8.7-1.el8
flatpak-session-helper Red Hat:enterprise_linux:8::appstreamAll versions0:1.8.7-1.el8
flatpak-session-helper-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.8.7-1.el8
flatpak-tests-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.8.7-1.el8
flatpak Red Hat:enterprise_linux:8::crbAll versions0:1.8.7-1.el8
flatpak-debuginfo Red Hat:enterprise_linux:8::crbAll versions0:1.8.7-1.el8
flatpak-debugsource Red Hat:enterprise_linux:8::crbAll versions0:1.8.7-1.el8
flatpak-devel Red Hat:enterprise_linux:8::crbAll versions0:1.8.7-1.el8
flatpak-libs-debuginfo Red Hat:enterprise_linux:8::crbAll versions0:1.8.7-1.el8
flatpak-session-helper Red Hat:enterprise_linux:8::crbAll versions0:1.8.7-1.el8
flatpak-session-helper-debuginfo Red Hat:enterprise_linux:8::crbAll versions0:1.8.7-1.el8
flatpak-tests-debuginfo Red Hat:enterprise_linux:8::crbAll versions0:1.8.7-1.el8
flatpak Rocky Linux:8All versions0:1.8.7-1.el8
flatpak openSUSE:TumbleweedAll versions1.12.3-1.1

Products include Debian Debian Linux, Fedoraproject Fedora, Flatpak Flatpak, Redhat Enterprise Linux.

How do I fix CVE-2021-43860?

Upgrade to a fixed version.

Is CVE-2021-43860 being exploited?

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

All Debian Debian Linux vulnerabilities

Sources

Also known as ALSA-2022:1792, CLEANSTART-2024-YF10316, CLSA-2026-1777541348, DEBIAN-CVE-2021-43860, GHSA-qpjc-vq3c-572j, OESA-2022-1520 and 4 more.

Is CVE-2021-43860 in your software?

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

Check your SBOMs for free