Junglewise Threat Intelligence

CVE-2026-40354: Flatpak xdg-desktop-portal symlink attack in Trash portal

CVE-2026-40354 · Severity: low · CVSS 2.9 · Published 2026-04-11

Vendors: Flatpak.

Executive brief

A vulnerability in the Flatpak desktop portal allows malicious or compromised applications to delete or move any file on the host computer to the trash. This bypasses the security sandbox intended to keep applications isolated from the rest of the system. An attacker could use this to disrupt system operations or delete critical user data.

Technical details

A Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in the Trash portal of xdg-desktop-portal. The portal uses the g_file_trash function on paths that can traverse client-controlled directory trees. A malicious Flatpak application can request the portal to trash a file it owns and then quickly replace that file with a symbolic link pointing to a file on the host system. Because the portal does not safely handle the symlink redirection during the trashing process, it may move the host-level target of the symlink to the trash instead of the intended application file. This issue is resolved in versions 1.20.4 and 1.21.1.

Affected products

  • Flatpak xdg-desktop-portal < 1.20.4, 1.21.0

Timeline

  • 2026-04-08: patched: Version 1.20.4 released
  • 2026-04-08: advisory: GitHub Security Advisory GHSA-rqr9-jwwf-wxgj published
  • 2026-04-10: disclosed: NVD publication date

References