mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-09-14 14:18:23 -04:00
The TOCTOU / symlink-race suite for the secure resolver and operator-supplied paths: chdir/chmod/rename/mknod/source/dest symlink races, relative make_path and symlinked-parent cases, the operator-path matrix (--temp/partial/backup-dir, alt-dest basis, files-from, log-file, insecure-links), and the admin-file opens (--password-file / daemon secrets / config / log-file / early-input symlinks), plus the daemon module-confinement and chroot inner-module cases. Co-authored-by: Omar Elsayed <omarelsayed161@gmail.com>
11 lines
537 B
Python
11 lines
537 B
Python
#!/usr/bin/env python3
|
|
from rsyncfns import run_checked, setup_chroot_inner
|
|
from rsyncfns import rsync_argv, test_fail
|
|
|
|
base, inner, outside, src, url = setup_chroot_inner('chroot-write-inner')
|
|
(src / 'pwn').write_text('payload\n')
|
|
proc, out = run_checked(rsync_argv('-a', str(src / 'pwn'), f'{url}mod/linkparent/pwn'))
|
|
if (outside / 'pwn').exists():
|
|
test_fail(f"receiver write escaped inner module through symlinked parent:\n{out}")
|
|
print("chroot-receiver-write-inner-module: symlinked parent did not publish outside inner module")
|