Ryan Gonzalez

#30535of 53,640
8.6Total CVSS
Vulnerabilities · 1
PT-2022-11921
8.6
2022-01-12
Flatpak · Flatpak · CVE-2021-43860
**Name of the Vulnerable Software and Affected Versions** Flatpak versions prior to 1.12.3 and 1.10.6 **Description** The issue arises from Flatpak's failure to 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, particularly when there's a null byte in the metadata file of an app. This allows apps to grant themselves permissions without the user's consent. The permissions are shown to the user by reading them from the `xa.metadata` key in the commit metadata, which cannot contain a null terminator because it is an untrusted GVariant. However, the actual metadata contents are loaded in several places where they are read as simple C-style strings, meaning that if the metadata file includes a null terminator, only the content 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. Users who have Flatpaks installed from untrusted sources are at risk if the Flatpak has a maliciously crafted metadata file, either initially or in an update. **Recommendations** For versions prior to 1.12.3 and 1.10.6, update to version 1.12.3 or 1.10.6 to resolve the issue. As a temporary workaround, users can manually check the permissions of installed apps by checking the metadata file or the `xa.metadata` key on the commit metadata.