Bug 2041590 (CVE-2021-43860) - CVE-2021-43860 flatpak: Permissions granted to applications can be hidden from the user at install time
Summary: CVE-2021-43860 flatpak: Permissions granted to applications can be hidden fro...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2021-43860
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2041591 2041972 2041973
Blocks: 2041595
TreeView+ depends on / blocked
 
Reported: 2022-01-17 18:52 UTC by Guilherme de Almeida Suckevicz
Modified: 2022-10-03 13:45 UTC (History)
5 users (show)

Fixed In Version: flatpak 1.12.3, flatpak 1.10.6
Doc Type: If docs needed, set a value
Doc Text:
An incorrect authorization vulnerability was found in Flatpak. Flatpak does not 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. This issue allows apps to grant themselves permissions without the user's consent.
Clone Of:
Environment:
Last Closed: 2022-05-11 23:15:12 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2022:1792 0 None None None 2022-05-10 13:26:33 UTC

Description Guilherme de Almeida Suckevicz 2022-01-17 18:52:08 UTC
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.

Reference:
https://github.com/flatpak/flatpak/security/advisories/GHSA-qpjc-vq3c-572j

Comment 1 Guilherme de Almeida Suckevicz 2022-01-17 18:52:22 UTC
Created flatpak tracking bugs for this issue:

Affects: fedora-all [bug 2041591]

Comment 5 errata-xmlrpc 2022-05-10 13:26:31 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:1792 https://access.redhat.com/errata/RHSA-2022:1792

Comment 6 Product Security DevOps Team 2022-05-11 23:15:11 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2021-43860


Note You need to log in before you can comment on or make changes to this bug.