You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local copy to a single-file destination writes through another user's symlink (CVE-2026-53796 residual) #8858
A local copy whose destination is a single file does not put the destination's parent through the ownership walk and does not pin it. A symlink owned by another user inside the destination path is followed, and the file is written outside the destination. rsync 3.5.2 refuses. This is a residual of CVE-2026-53796.
Reproduce
dest/sub is a symlink to outside, owned by another user (uid 65534). Run as an ordinary user:
oc-rsync -t src/f dest/sub/deeper/g
exit
result
rsync 3.5.2
3
prints the untrusted-symlink refusal and rsync: [Receiver] change_dir#3 "<base>/dest/sub/deeper" failed: Too many levels of symbolic links (40); outside is untouched
oc-rsync (master, and 0.6.4)
0
writes outside/deeper/g
Related rows on the same path:
fixture
rsync 3.5.2
oc-rsync
untrusted symlink is the immediate parent (dest/sub/g)
exit 3, same two lines
exit 23, cannot replace non-directory destination with directory, nothing written (fails closed, with the wrong message)
the user's own symlink is the immediate parent
follows it, exit 0
exit 23 with the same message (a plain bug)
real parent directory
copies
copies
A push or a pull into the same layouts is not affected: the network receivers walk and pin the parent before the transfer, and exit 3 with nothing written.
Cause
resolve_destination_like_change_dir in crates/core/src/client/run/mod.rs returns early when the destination is not a directory, so the parent is never walked or pinned. rsync 3.5.2 enters the parent with change_dir(parent, CD_NORMAL) (main.c:843-868), which goes through open_no_attacker_symlinks_dirfd and fchdir (util1.c:1448-1467).
Expected
The parent of a single-file local destination is walked and pinned as rsync 3.5.2 does, with its change_dir#3 line and exit 3 on refusal.
A symlinked parent the user owns is followed.
Tests against rsync 3.5.2 for the three fixtures above on local, push and pull, plus a parent swapped after entry, each failing without the fix.
A second layout escapes the same way: a local copy into a directory that does not exist yet, below another user's symlink.
dest/link is a symlink owned by another user, pointing at a directory outside the tree. oc-rsync -t src/f dest/link/new/:
exit
result
rsync 3.5.2
3
refusing to follow a symlink owned by an untrusted user; ... then change_dir#2 "<base>/dest/link/new" failed: Too many levels of symbolic links (40); nothing written
oc-rsync (master)
0
creates new/ through the link and writes the file there
Both come from the same early return: the destination is not an existing directory, so its parent is never walked or pinned. rsync 3.5.2 re-enters a destination it has just created through the same checked change_dir (main.c:817-839). The fix must cover the created-directory case as well as the single-file case.
For comparison, a local copy into an existing directory through the same link is refused with exit 3 on both; there only the order and wording of the lines differ.
Activity
oferchen commentedon Nov 26, 2026
A second layout escapes the same way: a local copy into a directory that does not exist yet, below another user's symlink.
dest/linkis a symlink owned by another user, pointing at a directory outside the tree.oc-rsync -t src/f dest/link/new/:refusing to follow a symlink owned by an untrusted user; ...thenchange_dir#2 "<base>/dest/link/new" failed: Too many levels of symbolic links (40); nothing writtennew/through the link and writes the file thereBoth come from the same early return: the destination is not an existing directory, so its parent is never walked or pinned. rsync 3.5.2 re-enters a destination it has just created through the same checked
change_dir(main.c:817-839). The fix must cover the created-directory case as well as the single-file case.For comparison, a local copy into an existing directory through the same link is refused with exit 3 on both; there only the order and wording of the lines differ.
test: let tests in any crate plant a foreign-owned symlink without ro…
fix: walk unchrooted daemon module roots and destinations (#8904)