]> git.ipfire.org Git - thirdparty/rsync.git/commit
sender: fix read-path TOCTOU by opening from module root (CVE-2026-29518)
authorAndrew Tridgell <andrew@tridgell.net>
Sat, 28 Feb 2026 22:28:40 +0000 (09:28 +1100)
committerAndrew Tridgell <andrew@tridgell.net>
Thu, 7 May 2026 21:49:13 +0000 (07:49 +1000)
commitdbfeb532c19256e04c38123c0fd92771f50e74af
tree446af535506a6bf919026b91fc16e85c645107c7
parented649cda5a09464d20387797fd18d04e3502b587
sender: fix read-path TOCTOU by opening from module root (CVE-2026-29518)

The sender's file open was vulnerable to the same TOCTOU symlink
race as the receiver-side basis-file open. change_pathname() calls
chdir() into subdirectories, which follows symlinks; an attacker
could race to swap a directory for a symlink between the chdir and
the file open, allowing reads of privileged files through the
daemon.

Reconstruct the full relative path (F_PATHNAME + fname) and open
via secure_relative_open() from the trusted module_dir, which
walks each path component without following symlinks. This is
independent of CWD, so the chdir race is neutralised.

CVE-2026-29518.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sender.c