CVE-2021-43860
Permissions granted to applications can be hidden from the user at install time
Check your servers for CVE-2021-43860
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-43860 affects flatpak, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- required: a user has to do something, such as open a link or a file
- Scope
- changed: the damage reaches other components, such as the host of a container or other users
- Impact
- confidentiality high, integrity high, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 1.44%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 73.9% of all scored CVEs. Scores of 1 Dec 2026.
Weakness
- CWE-269 Improper Privilege Management
Affected products
As the CNA lists them.
Is my server affected?
Find the installed version of flatpak and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i flatpak
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-43860 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-43860RHEL, Rocky, Alma, Fedora
rpm -q flatpak
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-43860Alpine
apk list --installed | grep -i flatpakWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2021-43860
trivy image --scanners vuln IMAGE | grep CVE-2021-43860
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- FEDORA-2022-825ca6bf2b lists.fedoraproject.org · vendor advisory
- DSA-5049 debian.org · vendor advisory
- GLSA-202312-12 security.gentoo.org · vendor advisory
Other references
- https://github.com/flatpak/flatpak/security/advisories/GHSA-qpjc-vq3c-572j github.com
- https://github.com/flatpak/flatpak/commit/54ec1a482dfc668127eaae57f135e6a8e0bc52da github.com
- https://github.com/flatpak/flatpak/commit/65cbfac982cb1c83993a9e19aa424daee8e9f042 github.com
- https://github.com/flatpak/flatpak/commit/93357d357119093804df05acc32ff335839c6451 github.com
- https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e github.com
- https://github.com/flatpak/flatpak/commit/d9a8f9d8ccc0b7c1135d0ecde006a75d25f66aee github.com
- https://github.com/flatpak/flatpak/releases/tag/1.10.6 github.com
- https://github.com/flatpak/flatpak/releases/tag/1.12.3 github.com
Source: the record CVE-2021-43860 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse