CVE-2022-21682

7.7 HIGH

📋 TL;DR

Flatpak versions before 1.12.3 and 1.10.6 contain a path traversal vulnerability in flatpak-builder when using the --mirror-screenshots-url option. This allows malicious applications to potentially execute arbitrary code by replacing the appstream-util binary. Users and developers building Flatpak applications with this option are affected.

💻 Affected Systems

Products:
  • Flatpak
Versions: All versions before 1.12.3 and 1.10.6
Operating Systems: Linux distributions with Flatpak support
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when using flatpak-builder with the --mirror-screenshots-url option during application builds.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Arbitrary code execution with the permissions of the user running flatpak-builder, potentially leading to full system compromise if run with elevated privileges.

🟠

Likely Case

Creation of empty directories in unintended locations where the user has write permissions, causing minor system disruption.

🟢

If Mitigated

No impact if the vulnerable option is not used or if proper file permissions prevent binary replacement.

🌐 Internet-Facing: LOW - This vulnerability requires local access or malicious Flatpak application installation.
🏢 Internal Only: MEDIUM - Developers building Flatpak packages could be affected, but requires specific build configuration.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires building a malicious Flatpak application and convincing users to build it with the vulnerable option.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.12.3 or 1.10.6

Vendor Advisory: https://github.com/flatpak/flatpak/security/advisories/GHSA-8ch7-5j3h-g4fx

Restart Required: No

Instructions:

1. Update Flatpak using your distribution's package manager. 2. For Ubuntu/Debian: sudo apt update && sudo apt upgrade flatpak. 3. For Fedora/RHEL: sudo dnf update flatpak. 4. For Arch: sudo pacman -Syu flatpak.

🔧 Temporary Workarounds

Avoid vulnerable option

linux

Do not use --mirror-screenshots-url when building Flatpak applications

🧯 If You Can't Patch

  • Avoid building Flatpak applications with --mirror-screenshots-url option
  • Run flatpak-builder with minimal privileges and in isolated environments

🔍 How to Verify

Check if Vulnerable:

Check Flatpak version: flatpak --version. If version is below 1.12.3 or 1.10.6, you are vulnerable when using --mirror-screenshots-url.

Check Version:

flatpak --version

Verify Fix Applied:

Run flatpak --version and confirm version is 1.12.3, 1.10.6 or higher.

📡 Detection & Monitoring

Log Indicators:

  • flatpak-builder processes using --mirror-screenshots-url option
  • unexpected appstream-util executions during builds

Network Indicators:

  • No network indicators for this local vulnerability

SIEM Query:

process.name:flatpak-builder AND command_line:*mirror-screenshots-url*

🔗 References

📤 Share & Export