CVE-2022-21682

flatpak-builder can access files outside the build directory.

Description

Flatpak is a Linux application sandboxing and distribution framework. A path traversal vulnerability affects versions of Flatpak prior to 1.12.3 and 1.10.6. flatpak-builder applies `finish-args` last in the build. At this point the build directory will have the full access that is specified in the manifest, so running `flatpak build` against it will gain those permissions. Normally this will not be done, so this is not problem. However, if `--mirror-screenshots-url` is specified, then flatpak-builder will launch `flatpak build --nofilesystem=host appstream-utils mirror-screenshots` after finalization, which can lead to issues even with the `--nofilesystem=host` protection. In normal use, the only issue is that these empty directories can be created wherever the user has write permissions. However, a malicious application could replace the `appstream-util` binary and potentially do something more hostile. This has been resolved in Flatpak 1.12.3 and 1.10.6 by changing the behaviour of `--nofilesystem=home` and `--nofilesystem=host`.

Category

7.7
CVSS
Severity: High
CVSS 3.1 •
CVSS 2.0 •
EPSS 0.27%
Vendor Advisory fedoraproject.org Vendor Advisory debian.org Vendor Advisory fedoraproject.org Vendor Advisory gentoo.org
Affected: flatpak flatpak
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2022-21682?
CVE-2022-21682 has been scored as a high severity vulnerability.
How to fix CVE-2022-21682?
To fix CVE-2022-21682, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2022-21682 being actively exploited in the wild?
As for now, there are no information to confirm that CVE-2022-21682 is being actively exploited. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2022-21682?
CVE-2022-21682 affects flatpak flatpak.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.