Repository navigation
test(transfer): legitimate symlink transfers must not regress (SEC-1.n) - #4678
Merged
Merged
Conversation
oferchen
force-pushed
the
test/sec-1-n-legitimate-symlinks-interop
branch
from
May 21, 2026 14:55
945c1f7 to
43628d6
Compare
Add a six-scenario integration regression that pins the SAFETY-of- legitimate-use counterpart to SEC-1.m's attack harness. The sandbox-anchored helpers introduced by SEC-1.f (and extended by SEC-1.g) tighten how the receiver stats and unlinks destination obstacles; this test asserts they do not regress legitimate symlink workflows the receiver emits every run with -l / -a: 1. Plain relative symlink preserved verbatim 2. Absolute symlink preserved verbatim (no --copy-unsafe-links) 3. Symlink to directory preserved with unique underlying contents 4. Broken symlink preserved without follow-error 5. Symlink chain preserved link-by-link, never flattened 6. Hardlink pair plus symlink-to-leader preserved together Each scenario shapes a receiver-style destination tree the same way the receiver's create_symlinks / create_hardlinks paths shape it, calls fast_io::lstat_via_sandbox_or_fallback (the SEC-1.f cutover the receiver already routes through), and asserts every legitimate symlink lands on disk with its target text byte-identical and adjacent inodes / contents untouched. The file uses only the SEC-1.f API surface present in current master (DirSandbox, LstatOutcome, lstat_via_sandbox_or_fallback), so it compiles cleanly while the SEC-1.g unlinkat surface is still in CI.
oferchen
force-pushed
the
test/sec-1-n-legitimate-symlinks-interop
branch
from
May 21, 2026 15:50
43628d6 to
d068fde
Compare
Merged
3 tasks
3 of 4 tasks
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…n) (#4678) Add a six-scenario integration regression that pins the SAFETY-of- legitimate-use counterpart to SEC-1.m's attack harness. The sandbox-anchored helpers introduced by SEC-1.f (and extended by SEC-1.g) tighten how the receiver stats and unlinks destination obstacles; this test asserts they do not regress legitimate symlink workflows the receiver emits every run with -l / -a: 1. Plain relative symlink preserved verbatim 2. Absolute symlink preserved verbatim (no --copy-unsafe-links) 3. Symlink to directory preserved with unique underlying contents 4. Broken symlink preserved without follow-error 5. Symlink chain preserved link-by-link, never flattened 6. Hardlink pair plus symlink-to-leader preserved together Each scenario shapes a receiver-style destination tree the same way the receiver's create_symlinks / create_hardlinks paths shape it, calls fast_io::lstat_via_sandbox_or_fallback (the SEC-1.f cutover the receiver already routes through), and asserts every legitimate symlink lands on disk with its target text byte-identical and adjacent inodes / contents untouched. The file uses only the SEC-1.f API surface present in current master (DirSandbox, LstatOutcome, lstat_via_sandbox_or_fallback), so it compiles cleanly while the SEC-1.g unlinkat surface is still in CI.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…n/.k/.l ship state Update CVE-2026-29518 and CVE-2026-43619 entries to "Mostly fixed", reflecting the SEC-1 sub-tasks now in master: - .a/.b/.c/.d/.e: DirSandbox carrier, openat2 detection, receiver wiring - .f: lstat to fstatat (PR #4668) - .g: remove to unlinkat (PR #4671) - .h: mkdir/symlink/hard_link to *at variants (PR #4683) - .k: macOS verified - .l: Windows audited (NTFS handle-based, not affected) - .m: symlink-swap attack regression (PR #4675) - .n: legitimate symlink interop regression (PR #4678) Remaining work explicitly listed: - .i (chmod/lchown/utimes to *at) - in flight - .j (rename to renameat) - in flight - mknodat for device/FIFO nodes - deferred (not daemon-reachable) - Receiver wiring for SEC-1.i helpers - deferred (carrier-first staging) Target full-Fixed status: when SEC-1.i and SEC-1.j ship and all receiver call sites are wired through DirSandbox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SEC-1.n is the SAFETY-of-LEGITIMATE-USE counterpart to SEC-1.m's attack harness (#4675, in CI). The sandbox-anchored helpers introduced by SEC-1.f (
fstatat(AT_SYMLINK_NOFOLLOW), #4668 merged) and extended by SEC-1.g (unlinkatfamily, #4671 in CI) tighten how the receiver stats and unlinks destination obstacles. This test pins the inverse invariant: every legitimate symlink rsync emits with-l/-amust continue to land on disk verbatim, with target text byte-identical and adjacent inodes / contents untouched.Six scenarios mirror upstream rsync legitimate-use cases:
dir/link -> target.txtpreserved verbatim.dir/link -> /etc/hostnamepreserved verbatim, even without--copy-unsafe-links.dir/link -> subdir/preserved as a symlink;subdir/file.txtlands once as a regular file, not duplicated through the link.dir/dangling -> nonexistentpreserved; the sandbox-anchored stat reports the symlink (not ENOENT via follow); receiver does not fail.a -> b -> c -> file.txtpreserved link-by-link, never flattened.-aH,hl1/hl2share an inode ANDsl -> hl1is preserved as a symlink (distinct inode from the hardlinked pair).Compile compatibility
The file uses only the SEC-1.f API surface present in current master (
fast_io::DirSandbox,fast_io::LstatOutcome,fast_io::lstat_via_sandbox_or_fallbackfrom #4668). It deliberately does NOT consume the SEC-1.gUnlinkFlags/unlink_via_sandbox_or_fallbacksurface from #4671, so the test compiles cleanly against master while #4671 is still in CI. Once #4671 lands, the unlink-class assertions can be tightened in a follow-up without changing this file.Like SEC-1.m, this harness does not stand up a full receiver pipeline. The SEC-1 invariants live in
fast_io::lstat_via_sandbox_or_fallbackand the receiver consumes them through theDirSandboxcarrier (SEC-1.e). Each scenario shapes a receiver-style destination tree the same way the receiver'screate_symlinksandcreate_hardlinkspaths shape it, then calls the same helpers the receiver calls.Gated
#![cfg(unix)]; Windows skips the test module entirely.Closes #2532.
Test plan
cargo nextest run -p transfer --all-features -E 'test(sec_1_n)'passes on Linuxcfg(unix)