Elektrine lite

← Feed

@ChrisG@lemmy.world

Post #2085651

2026-04-04 09:54 UTC

Any errant application can expose this glaring systemd flaw

Replies (1)

  • @FauxLiving@lemmy.world 2026-04-04 10:25

    There is no systemd flaw here. snap-confine creates /tmp/.snap owned by root. systemd-tmpfiles can delete this directory because it also has root privileges. It will do so if the directory is inactive for, by default, 30 days. Files can be excluded from this by adding a .conf file to /etc/tmpfiles.d/, snap-confine does not do this. Because the files are not excluded they will be deleted. systemd-tmpfiles can do this because it is running as root. Once they are deleted a USER can recreate /tmp/.snap with malicious code. snap-confine **never verifies that the directory is owned by root**, and performs its security checks *before* its privileged file operations, creating a race window. Because snap-confine is setuid root, it then bind-mounts files from the attacker-controlled /tmp/.snap into the snap sandbox's filesystem, allowing an attacker to execute arbitrary code as root. What is the systemd-tmpfiles flaw? It does exactly what it is supposed to do, and it provides a means to exclude directories from its process. snap doesn't configure systemd to ignore the directories and it doesn't perform appropriate checks on the directory's ownership.

    Open ##2085652