CVE-2024-42472: Flatpak may allow access to files outside sandbox for certain apps

Published Aug 14, 2024
·
Updated

Flatpak is a Linux application sandboxing and distribution framework. Prior to versions 1.14.0 and 1.15.10, a malicious or compromised Flatpak app using persistent directories could access and write files outside of what it would otherwise have access to, which is an attack on integrity and confidentiality.

When persistent=subdir is used in the application permissions (represented as --persist=subdir in the command-line interface), that means that an application which otherwise doesn't have access to the real user home directory will see an empty home directory with a writeable subdirectory subdir. Behind the scenes, this directory is actually a bind mount and the data is stored in the per-application directory as ~/.var/app/$APPID/subdir. This allows existing apps that are not aware of the per-application directory to still work as intended without general home directory access.

However, the application does have write access to the application directory ~/.var/app/$APPID where this directory is stored. If the source directory for the persistent/--persist option is replaced by a symlink, then the next time the application is started, the bind mount will follow the symlink and mount whatever it points to into the sandbox.

Partial protection against this vulnerability can be provided by patching Flatpak using the patches in commits ceec2ffc and 98f79773. However, this leaves a race condition that could be exploited by two instances of a malicious app running in parallel. Closing the race condition requires updating or patching the version of bubblewrap that is used by Flatpak to add the new --bind-fd option using the patch and then patching Flatpak to use it. If Flatpak has been configured at build-time with -Dsystembubblewrap=bwrap (1.15.x) or --with-system-bubblewrap=bwrap (1.14.x or older), or a similar option, then the version of bubblewrap that needs to be patched is a system copy that is distributed separately, typically /usr/bin/bwrap. This configuration is the one that is typically used in Linux distributions. If Flatpak has been configured at build-time with -Dsystembubblewrap= (1.15.x) or with --without-system-bubblewrap (1.14.x or older), then it is the bundled version of bubblewrap that is included with Flatpak that must be patched. This is typically installed as /usr/libexec/flatpak-bwrap. This configuration is the default when building from source code.

For the 1.14.x stable branch, these changes are included in Flatpak 1.14.10. The bundled version of bubblewrap included in this release has been updated to 0.6.3. For the 1.15.x development branch, these changes are included in Flatpak 1.15.10. The bundled version of bubblewrap in this release is a Meson "wrap" subproject, which has been updated to 0.10.0. The 1.12.x and 1.10.x branches will not be updated for this vulnerability. Long-term support OS distributions should backport the individual changes into their versions of Flatpak and bubblewrap, or update to newer versions if their stability policy allows it. As a workaround, avoid using applications using the persistent (--persist) permission.

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

— Launchpad

Affected Software

17 affected componentsFixes available
Flatpak Flatpak>=1.14.0<1.14.10
Flatpak Flatpak>=1.15.0<1.15.10
Debian Debian Linux=11.0
debian/flatpak<1.14.10-1~deb12u1
1.14.10-1~deb12u1
debian/flatpak<1.14.10-1
1.14.10-1
debian/flatpak<1.14.10-1
1.14.10-1
debian/flatpak
1.14.10-1~deb12u21.16.6-1~deb13u21.16.6-1~deb13u31.18.4-1
alpine/bubblewrap<0.10.0-r0
0.10.0-r0
alpine/bubblewrap<0.10.0-r0
0.10.0-r0
alpine/bubblewrap<0.10.0-r0
0.10.0-r0
alpine/bubblewrap<0.10.0-r0
0.10.0-r0
alpine/bubblewrap<0.10.0-r0
0.10.0-r0
alpine/flatpak>=1.14.0<1.14.10-r0
1.14.10-r0
alpine/flatpak>=1.14.0<1.14.10-r0
1.14.10-r0
alpine/flatpak>=1.14.0<1.14.10-r0
1.14.10-r0
alpine/flatpak>=1.14.0<1.14.10-r0
1.14.10-r0
alpine/flatpak>=1.14.0<1.14.10-r0
1.14.10-r0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/flatpak to a version that resolves this vulnerability.

    Fixed in 1.14.10-1~deb12u1
  2. Upgrade

    Upgrade debian/flatpak to a version that resolves this vulnerability.

    Fixed in 1.14.10-1
  3. Upgrade

    Upgrade debian/flatpak to a version that resolves this vulnerability.

    Fixed in 1.14.10-1~deb12u2Fixed in 1.16.6-1~deb13u2Fixed in 1.16.6-1~deb13u3Fixed in 1.18.4-1
  4. Upgrade

    Upgrade alpine/bubblewrap to a version that resolves this vulnerability.

    Fixed in 0.10.0-r0
  5. Upgrade

    Upgrade alpine/flatpak to a version that resolves this vulnerability.

    Fixed in 1.14.10-r0
  6. Upgrade

    Upgrade Flatpak to a version that resolves this vulnerability.

    Fixed in 1.14.10
  7. Upgrade

    Upgrade Flatpak to a version that resolves this vulnerability.

    Fixed in 1.15.10
  8. Upgrade

    Upgrade Flatpak to a version that resolves this vulnerability.

    Patch ceec2ffc
  9. Upgrade

    Upgrade Flatpak to a version that resolves this vulnerability.

    Patch 98f79773
  10. Upgrade

    Upgrade bubblewrap to a version that resolves this vulnerability.

    Fixed in 0.10.0
  11. Upgrade

    Upgrade bubblewrap to a version that resolves this vulnerability.

    Fixed in 0.6.3
  12. Compensating control

    Avoid using applications that use the persistent (--persist) permission.

Event History

Aug 15, 2024
CVE Published
via MITRE·06:32 PM
Data Sourced
via MITRE·06:32 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·07:15 PM
DescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2024-42472?

CVE-2024-42472 is considered a moderate severity vulnerability, as it allows compromised Flatpak apps to access files outside their designated areas.

2

How do I fix CVE-2024-42472?

To mitigate CVE-2024-42472, upgrade Flatpak to version 1.14.0 or later, or ensure that you are using version 1.15.10 or later.

3

What versions of Flatpak are affected by CVE-2024-42472?

CVE-2024-42472 affects Flatpak versions prior to 1.14.0 and 1.15.10.

4

What type of attack does CVE-2024-42472 involve?

CVE-2024-42472 involves an attack where a compromised Flatpak application can access and write files outside of its intended sandbox.

5

Is there a specific software source that needs to be updated for CVE-2024-42472?

Yes, for CVE-2024-42472, users need to update the Flatpak package from the Debian repository.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203