// For flags

CVE-2022-21682

flatpak-builder can access files outside the build directory.

Severity Score

6.5
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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`.

Flatpak es un marco de distribución y sandboxing de aplicaciones Linux. Una vulnerabilidad de salto de ruta afecta a las versiones de Flatpak anteriores a 1.12.3 y 1.10.6. flatpak-builder aplica "finish-args" en último lugar en la construcción. En este punto, el directorio de construcción tendrá el acceso completo que es especificado en el manifiesto, por lo que la ejecución de "flatpak build" contra él ganará esos permisos. Normalmente esto no se realiza, por lo que no es un problema. Sin embargo, si se especifica "--mirror-screenshots-url", entonces flatpak-builder lanzará "flatpak build --nofilesystem=host appstream-utils mirror-screenshots" tras la finalización, lo que puede conllevar a problemas incluso con la protección "--nofilesystem=host". En un uso normal, el único problema es que estos directorios vacíos pueden crearse en cualquier lugar donde el usuario tenga permisos de escritura. Sin embargo, una aplicación maliciosa podría reemplazar el binario "appstream-util" y potencialmente hacer algo más hostil. Esto ha sido resuelto en Flatpak versiones 1.12.3 y 1.10.6, al cambiar el comportamiento de "--nofilesystem=home" y "--nofilesystem=host"

A path traversal vulnerability was found in Flatpak. This happens when 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.

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
None
Integrity
High
Availability
None
Attack Vector
Network
Attack Complexity
Low
Authentication
Single
Confidentiality
None
Integrity
Partial
Availability
None
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2021-11-16 CVE Reserved
  • 2022-01-13 CVE Published
  • 2024-04-06 EPSS Updated
  • 2024-08-03 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Flatpak
Search vendor "Flatpak"
Flatpak
Search vendor "Flatpak" for product "Flatpak"
< 1.10.7
Search vendor "Flatpak" for product "Flatpak" and version " < 1.10.7"
-
Affected
Flatpak
Search vendor "Flatpak"
Flatpak
Search vendor "Flatpak" for product "Flatpak"
>= 1.11.1 < 1.12.4
Search vendor "Flatpak" for product "Flatpak" and version " >= 1.11.1 < 1.12.4"
-
Affected
Flatpak
Search vendor "Flatpak"
Flatpak-builder
Search vendor "Flatpak" for product "Flatpak-builder"
< 1.2.2
Search vendor "Flatpak" for product "Flatpak-builder" and version " < 1.2.2"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Fedora
Search vendor "Fedoraproject" for product "Fedora"
35
Search vendor "Fedoraproject" for product "Fedora" and version "35"
-
Affected
Redhat
Search vendor "Redhat"
Enterprise Linux
Search vendor "Redhat" for product "Enterprise Linux"
8.0
Search vendor "Redhat" for product "Enterprise Linux" and version "8.0"
-
Affected
Debian
Search vendor "Debian"
Debian Linux
Search vendor "Debian" for product "Debian Linux"
9.0
Search vendor "Debian" for product "Debian Linux" and version "9.0"
-
Affected
Debian
Search vendor "Debian"
Debian Linux
Search vendor "Debian" for product "Debian Linux"
10.0
Search vendor "Debian" for product "Debian Linux" and version "10.0"
-
Affected
Debian
Search vendor "Debian"
Debian Linux
Search vendor "Debian" for product "Debian Linux"
11.0
Search vendor "Debian" for product "Debian Linux" and version "11.0"
-
Affected