]> git.ipfire.org Git - thirdparty/rsync.git/commit
syscall+clientserver: am_chrooted and use_secure_symlinks for daemon-no-chroot (CVE...
authorAndrew Tridgell <andrew@tridgell.net>
Tue, 30 Dec 2025 23:01:23 +0000 (10:01 +1100)
committerAndrew Tridgell <andrew@tridgell.net>
Thu, 7 May 2026 21:48:53 +0000 (07:48 +1000)
commited649cda5a09464d20387797fd18d04e3502b587
treecc24683a07e31c3901ceb81d21ad59519b3b0c2a
parentb9cc0c6176d0eb065b1524ea5b182565250ef29c
syscall+clientserver: am_chrooted and use_secure_symlinks for daemon-no-chroot (CVE-2026-29518)

CVE-2026-29518: an rsync daemon configured with "use chroot = no"
is exposed to a TOCTOU race on parent path components. A local
attacker with write access to a module can replace a parent
directory component with a symlink between the receiver's check
and its open(), redirecting reads (basis-file disclosure) and
writes (file overwrite) outside the module. Under elevated daemon
privilege this allows privilege escalation. Default
"use chroot = yes" is not exposed.

Add secure_relative_open() in syscall.c. It walks the parent
components under RESOLVE_BENEATH (Linux 5.6+) /
O_RESOLVE_BENEATH (FreeBSD 13+, macOS 15+) / per-component
O_NOFOLLOW elsewhere, anchored at a trusted dirfd, so a parent-
symlink swap is rejected by the kernel. Route the receiver's
basis-file open in receiver.c through it when use_secure_symlinks
is set in clientserver.c rsync_module().

Reporters: Nullx3D (Batuhan SANCAK); Damien Neil; Michael Stapelberg.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
clientserver.c
options.c
receiver.c
syscall.c