Systemd: systemd-tmpfiles symlink-redirected arbitrary file overwrite via a chase_safe root-to-unprivileged ownership transition bypass
A flaw was found in systemd-tmpfiles. When processing a tmpfiles.d configuration entry that writes to a file, systemd-tmpfiles can follow a symbolic link placed by an unprivileged local user, and an existing safety check does not detect this specific case because it always treats transitions away from the root user as safe. On systems where a tmpfiles.d configuration targets a path an unprivileged user can influence, this could allow that user to redirect a privileged systemd-tmpfiles write to a file of their choosing, though the content written remains determined by the existing configuration rather than by the unprivileged user. The highest threat from this vulnerability is to integrity.
Restrict or audit any custom tmpfiles.d configuration entries (e.g. authored via configuration-management tooling) that use the 'w' item type against paths under /run/user/*, per-user home directories, or other locations where an unprivileged user can influence path resolution, until an upstream fix is available.
Exploits
Credits
Red Hat would like to thank İbrahim Sağlam (Eresus Security) for reporting this issue.