/

CVE-2026-34079

Severity:

HIGH RISK

(7.5)

Path Traversal in Flatpak ld.so Cache Handling

CVE-2026-34079

Analyzed

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22

Impact:

Arbitrary File Deletion on Host System

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal flaw in Flatpak's ld.so cache handling allows applications to influence which files are treated as outdated cache entries and removed from the host system.

When a Flatpak app can control paths to these cache files without proper directory validation, it may be able to delete arbitrary files on the host, potentially impacting system integrity and availability.

Affected context

This vulnerability occurs in Flatpak's management of ld.so cache files when cleaning up outdated entries.

It is relevant in environments where:

  • Flatpak is used to run sandboxed applications
  • Applications can control or influence paths to cache entries used by ld.so
  • The cleanup logic removes files based on those paths without strictly confirming they reside within the intended cache directory

The issue manifests at the boundary between the containerized app's filesystem view and the host's file system cleanup logic.

Exploit preconditions

  • Attack surface: Flatpak runtime environment on a Linux host.
  • Required access: Ability to run or control a Flatpak application that can influence the path to ld.so cache files.
  • Trigger point: Invocation of ld.so cache cleanup logic that removes "outdated" cache files.
  • Why exploitation is possible: The cleanup procedure fails to robustly verify that the file being removed is actually within the intended cache directory, allowing path traversal or misdirected paths to point to arbitrary host files.

Why this happens

The underlying flaw is an improper validation of file paths before deletion, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory (Path Traversal).

The cache cleanup logic assumes that paths to outdated ld.so cache files are safely contained within a designated cache directory but does not rigorously enforce this constraint.

As a result, a Flatpak application that can control or influence these paths can cause the cleanup mechanism to operate on arbitrary filesystem locations, turning a maintenance feature into an unintended file deletion primitive.

Potential impact

  • Deletion of arbitrary files on the host filesystem that the Flatpak process or helper has permission to remove
  • Removal of critical configuration or application files, leading to denial of service or system instability
  • Deletion of security-related artifacts such as logs, temporary security tokens, or policy files, potentially hampering incident response
  • Targeted disruption of other applications or services sharing the same host

General mitigation guidance

Effective mitigation focuses on enforcing strict directory boundaries and defensive file handling patterns:

  • Normalize and canonicalize file paths (e.g., using realpath-like mechanisms) before any deletion, and verify that the resolved path is within the intended cache directory.
  • Use whitelisting based on known-safe root directories instead of trusting app-controlled paths.
  • Separate application-controlled data from maintenance or cleanup routines that operate with elevated privileges.
  • Apply least-privilege principles so that components responsible for cache cleanup can only remove files within tightly scoped directories.
  • Add defensive checks for unexpected symlinks, path traversal sequences, or indirect references when dealing with cache or temporary files.

How teams detect issues like this

Organizations can look for this class of issue using a combination of static and operational checks:

  • Static analysis: Rules that flag file deletion APIs used with non-validated or user-controlled paths, and that verify canonical path checks against fixed directories.
  • Code review: Explicit review of maintenance and cleanup routines that delete files, ensuring they resolve paths safely and enforce directory constraints.
  • Runtime monitoring: File integrity monitoring or audit logs to detect unexpected deletions in system or application directories initiated by Flatpak-related processes.
  • Policy enforcement: CI/CD gates requiring secure file-handling patterns and prohibiting direct deletion of paths derived from application input without directory boundary checks.

Sources

SourceLink
github.comgithub.com/flatpak/flatpak/security/advisories/GHSA-p29x-r292-46pp

Frequently asked

questions

It is not directly remote in the traditional network sense. Exploitation requires the ability to run or influence a Flatpak application on the target host. However, if a user is tricked into installing and running a malicious Flatpak app, the attack can effectively originate from remote distribution channels.

The attacker needs the capability to execute or control a Flatpak app in the affected environment. Within that context, they must be able to affect the paths used for ld.so cache entries so that the cleanup mechanism targets arbitrary files.

The safest pattern is to strictly resolve and validate file paths before deletion, ensuring they are confined to a predefined, trusted directory. This includes canonicalizing paths, rejecting any that escape the allowed root, and avoiding reliance on app-controlled paths for privileged cleanup operations.

Prevention involves adopting consistent secure file-handling practices: treat any path influenced by untrusted input as unsafe, enforce directory whitelists with canonical path checks, separate privilege boundaries for maintenance tasks, and integrate automated checks that flag potentially unsafe deletion or modification of files based on user-controlled paths.

Find out what's already
exploitable in your codebase.