Repository navigation
fix: gate client merge files against daemon filters (CVE-2026-53786) - #8223
Merged
Merged
Conversation
Pushes with --delete and a client `: secret` rule into a module whose filter hides `secret`. Upstream 3.5.1 treats the hidden merge file as absent (exclude.c:1638-1659); on master oc reads it, so four scenarios fail while the ungated control passes.
A pushing client could name a module-hidden file as a per-directory merge file over the filter list, and the daemon receiver read it, so its rules steered --delete (CVE-2026-53786). The merge-file gate was only installed on the sender, and it judged the path relative to the transfer root, so an anchored module rule missed when the transfer was rooted in a module subdirectory. Install the module rules as the gate on the receiver chains too, and record the module root so every merge file is judged module-relative, mirroring exclude.c:1638-1659 parse_filter_file(). Adds pull and argv coverage plus a filters unit test, and corrects the audit and SECURITY rows that called the daemon immune by absence.
This was referenced Oct 20, 2026
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
--filter=': secret', sent over the filter list) made the daemon read a file its module filter hides, so that file's rules steered--delete. The merge-file gate was installed only on the daemon sender.exclude = /sub/secretmissed on a push or pull rooted in a module subdirectory. This affected the sender too.Details
Upstream contract.
exclude.c:1638-1659parse_filter_file()runs every merge-file open throughcheck_filter(&daemon_filter_list, ...), on the merge file's path withmodule_dirlenstripped, on both roles. A hidden merge file is treated as non-existent: no error, no rules read.What oc did on master (22a42b0).
compile_receiver_filter_chainsbuilt the receiver'sfilter_chainanddeletion_filter_chainfrom the module rules plus the client's wire rules, including dir-merge configs, without callingset_daemon_filter_gate. The delete pass's per-directory reload therefore opened any merge file the client named.FilterChain::daemon_gate_hidesbuilt the name relative totransfer_root, the push or pull target, not the module root.Fix.
filters:FilterChain::set_daemon_gate_rootrecords the module root.daemon_gate_hidesnow judgesdirectory.strip_prefix(module_root)/filename, falling back to the transfer-relative form outside a daemon.install_daemon_merge_gateinstalls the module's rules alone as the gate onfilter_chain.deletion_filter_chaininherits it through the clone, so the--deleteper-directory reload and--delete-excludedare covered.generator/filters.rsrecords the module root as well.Oracle. Each scenario was run against an upstream 3.5.1 daemon. The
secretmerge file holds- decoy, anddecoyexists only on the destination (push) or only on the module side (pull). Push and pull with--filter=': secret'; all runs exit 0.secretread,decoykeptexclude = secretdecoydeletedfilter = - secreta/secret,exclude = secretmod/sub/,exclude = /sub/secretmod/sub/,exclude = /sub/secretdecoysent-M--filter=': secret'(server argv),exclude = secretServer-argv filter options. oc's daemon does not apply filter options a client forwards into the server argv with
-M/--remote-option(long_form_args.rsdefault arm). Upstream applies them, and refuses a daemon-excluded--exclude-fromwith exit 4. So no hidden file is read on either side. The ungated-M--filtercase is a fidelity difference rather than a leak, and is left unchanged here.Test plan
cargo nextest run --all-features -E "binary(daemon_client_filter_merge_does_not_read_hidden_file)": 7 tests. Committed first as RED on master (4 of 5 initial tests failed with "the daemon read ..."; the ungated control passed). All 7 pass on this branch.cargo nextest run -p filters -p transfer -p daemon --all-features: 6972 passed. Root filter, merge and exclude tests (includingintegration_daemon_filter_directives): 83 passed.cargo nextest run -p filters -E "test(daemon_gate)", including the newdaemon_gate_root_matches_the_module_relative_merge_pathwith its non-vacuity half.cargo fmt --all -- --check,python3 tools/ci/check_rustfmt_all.pycargo clippy -p filters -p transfer -p daemon -p bin --all-targets --all-features --no-deps -- -D warningscargo check --target x86_64-pc-windows-gnu -p filters -p transfer -p daemonpython3 tools/ci/unsafe_owner_deps.py,cargo run -p xtask -- no-placeholders,cargo run -p xtask -- citationsdaemon-filter-merge-bypass), interop.Coordination
Conventional commit prefix
fix:- security bug fix (the history is a failing-firsttest:commit followed by thefix:).Security considerations
exclude/filter/exclude fromparameters, reached by a client that sends a dir-merge rule. On a push with--delete, the hidden file's rules decided which destination files survived. A crafted file could also inject rules from a path the module meant to hide, and with module-anchored rules this applied to pulls rooted in a subdirectory too. The file's content was never sent back verbatim by this path.tests/daemon_client_filter_merge_does_not_read_hidden_file.rscovers push, nested, anchored push and pull, and the argv vectors, all matched against upstream 3.5.1. A unit test infilters/src/chain/tests.rspins the module-relative path.SECURITY.mdCVE-2026-53786 row;docs/audits/cve-uts351-matrix.mdrow and finding 7, both corrected;exclude.c:1638-1659.Pre-merge checklist
cargo fmt --allrun locally.CHANGELOG.mdupdated if user-visible.SECURITY.mdupdated if security-relevant.