Vulnerability Name:

CVE-2021-21381 (CCN-198082)

Assigned:2020-12-22
Published:2021-03-09
Updated:2021-03-25
Summary:Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux. In Flatpack since version 0.9.4 and before version 1.10.2 has a vulnerability in the "file forwarding" feature which can be used by an attacker to gain access to files that would not ordinarily be allowed by the app's permissions. By putting the special tokens `@@` and/or `@@u` in the Exec field of a Flatpak app's .desktop file, a malicious app publisher can trick flatpak into behaving as though the user had chosen to open a target file with their Flatpak app, which automatically makes that file available to the Flatpak app. This is fixed in version 1.10.2. A minimal solution is the first commit "`Disallow @@ and @@U usage in desktop files`". The follow-up commits "`dir: Reserve the whole @@ prefix`" and "`dir: Refuse to export .desktop files with suspicious uses of @@ tokens`" are recommended, but not strictly required. As a workaround, avoid installing Flatpak apps from untrusted sources, or check the contents of the exported `.desktop` files in `exports/share/applications/*.desktop` (typically `~/.local/share/flatpak/exports/share/applications/*.desktop` and `/var/lib/flatpak/exports/share/applications/*.desktop`) to make sure that literal filenames do not follow `@@` or `@@u`.
CVSS v3 Severity:8.2 High (CVSS v3.1 Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N)
7.1 High (Temporal CVSS v3.1 Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N/E:U/RL:O/RC:C)
Exploitability Metrics:Attack Vector (AV): Local
Attack Complexity (AC): Low
Privileges Required (PR): None
User Interaction (UI): Required
Scope:Scope (S): Changed
Impact Metrics:Confidentiality (C): High
Integrity (I): High
Availibility (A): None
6.8 Medium (CCN CVSS v3.1 Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N)
5.9 Medium (CCN Temporal CVSS v3.1 Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N/E:U/RL:O/RC:C)
Exploitability Metrics:Attack Vector (AV): Local
Attack Complexity (AC): Low
Privileges Required (PR): None
User Interaction (UI): None
Scope:Scope (S): Unchanged
Impact Metrics:Confidentiality (C): Low
Integrity (I): High
Availibility (A): None
8.1 High (REDHAT CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N)
7.1 High (REDHAT Temporal CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N/E:U/RL:O/RC:C)
Exploitability Metrics:Attack Vector (AV): Network
Attack Complexity (AC): Low
Privileges Required (PR): Low
User Interaction (UI): None
Scope:Scope (S): Unchanged
Impact Metrics:Confidentiality (C): High
Integrity (I): High
Availibility (A): None
CVSS v2 Severity:5.8 Medium (CVSS v2 Vector: AV:N/AC:M/Au:N/C:P/I:P/A:N)
Exploitability Metrics:Access Vector (AV): Network
Access Complexity (AC): Medium
Authentication (Au): None
Impact Metrics:Confidentiality (C): Partial
Integrity (I): Partial
Availibility (A): None
5.6 Medium (CCN CVSS v2 Vector: AV:L/AC:L/Au:N/C:P/I:C/A:N)
Exploitability Metrics:Access Vector (AV): Local
Access Complexity (AC): Low
Athentication (Au): None
Impact Metrics:Confidentiality (C): Partial
Integrity (I): Complete
Availibility (A): None
Vulnerability Type:CWE-74
CWE-284
Vulnerability Consequences:Bypass Security
References:Source: MITRE
Type: CNA
CVE-2021-21381

Source: XF
Type: UNKNOWN
flatpak-cve202121381-info-disc(198082)

Source: MISC
Type: Patch, Third Party Advisory
https://github.com/flatpak/flatpak/commit/8279c5818425b6812523e3805bbe242fb6a5d961

Source: MISC
Type: Patch, Third Party Advisory
https://github.com/flatpak/flatpak/commit/a7401e638bf0c03102039e216ab1081922f140ae

Source: MISC
Type: Patch, Third Party Advisory
https://github.com/flatpak/flatpak/commit/eb7946bb6248923d8c90fe9b84425fef97ae580d

Source: MISC
Type: Patch, Third Party Advisory
https://github.com/flatpak/flatpak/pull/4156

Source: MISC
Type: Release Notes, Third Party Advisory
https://github.com/flatpak/flatpak/releases/tag/1.10.2

Source: CCN
Type: Flatpak GIT Repository
Sandbox escape via special tokens in .desktop file (flatpak#4146)

Source: CONFIRM
Type: Third Party Advisory
https://github.com/flatpak/flatpak/security/advisories/GHSA-xgh4-387p-hqpp

Source: FEDORA
Type: Mailing List, Third Party Advisory
FEDORA-2021-fe7decc595

Source: FEDORA
Type: Mailing List, Third Party Advisory
FEDORA-2021-26ad138ffa

Source: DEBIAN
Type: Third Party Advisory
DSA-4868

Vulnerable Configuration:Configuration 1:
  • cpe:/a:flatpak:flatpak:*:*:*:*:*:*:*:* (Version >= 0.9.4 and < 1.10.2)

  • Configuration 2:
  • cpe:/o:debian:debian_linux:10.0:*:*:*:*:*:*:*

  • Configuration 3:
  • cpe:/o:fedoraproject:fedora:33:*:*:*:*:*:*:*
  • OR cpe:/o:fedoraproject:fedora:34:*:*:*:*:*:*:*

  • Configuration RedHat 1:
  • cpe:/o:redhat:enterprise_linux:7:*:*:*:*:*:*:*

  • Configuration RedHat 2:
  • cpe:/o:redhat:enterprise_linux:7::client:*:*:*:*:*

  • Configuration RedHat 3:
  • cpe:/o:redhat:enterprise_linux:7::computenode:*:*:*:*:*

  • Configuration RedHat 4:
  • cpe:/o:redhat:enterprise_linux:7::server:*:*:*:*:*

  • Configuration RedHat 5:
  • cpe:/o:redhat:enterprise_linux:7::workstation:*:*:*:*:*

  • Configuration RedHat 6:
  • cpe:/a:redhat:enterprise_linux:8:*:*:*:*:*:*:*

  • Configuration RedHat 7:
  • cpe:/a:redhat:enterprise_linux:8::appstream:*:*:*:*:*

  • Configuration CCN 1:
  • cpe:/a:flatpak:flatpak:0.9.4:*:*:*:*:*:*:*

  • * Denotes that component is vulnerable
    Oval Definitions
    Definition IDClassTitleLast Modified
    oval:com.redhat.rhsa:def:20211068
    P
    RHSA-2021:1068: flatpak security update (Important)
    2021-04-06
    oval:com.redhat.rhsa:def:20211002
    P
    RHSA-2021:1002: flatpak security update (Important)
    2021-03-29
    BACK
    flatpak flatpak *
    debian debian linux 10.0
    fedoraproject fedora 33
    fedoraproject fedora 34
    flatpak flatpak 0.9.4