Repository navigation
test: pin hostname ACL resolution before chroot per GHSA-rjfm-3w2m-jf4f - #5533
Merged
Merged
Conversation
Adds a regression test mirroring Scenario B of upstream's `testsuite/daemon-chroot-acl.test`: with `use chroot = yes` and a hostname-pattern `hosts allow` rule, a connection whose reverse DNS fails post-chroot must be refused (not admitted by default). The deny-side bypass (Scenario A) was fixed and pinned by the fail-closed guard in `permits()` (commit 50f389f); the allow-side is already structurally fail-closed because a `Hostname(_)` pattern returns `false` when the peer hostname is `None`, so a hostname-only allow list cannot be satisfied by an unresolvable peer. This test locks that property in so future refactors of `permits()` cannot accidentally introduce an allowed-by-default path for the allow-side.
2 tasks
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
… (#5533) * test: pin hostname ACL resolution before chroot per GHSA-rjfm-3w2m-jf4f Adds a regression test mirroring Scenario B of upstream's `testsuite/daemon-chroot-acl.test`: with `use chroot = yes` and a hostname-pattern `hosts allow` rule, a connection whose reverse DNS fails post-chroot must be refused (not admitted by default). The deny-side bypass (Scenario A) was fixed and pinned by the fail-closed guard in `permits()` (commit 23f97c7); the allow-side is already structurally fail-closed because a `Hostname(_)` pattern returns `false` when the peer hostname is `None`, so a hostname-only allow list cannot be satisfied by an unresolvable peer. This test locks that property in so future refactors of `permits()` cannot accidentally introduce an allowed-by-default path for the allow-side. * fix: drop needless Option::as_deref in hostname ACL chroot test
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
Adds a single regression test pinning Scenario B of upstream's
testsuite/daemon-chroot-acl.testfor GHSA-rjfm-3w2m-jf4f /CVE-2026-43617: a daemon module with
use chroot = yesand ahostname-based
hosts allowrule must refuse a connection whosereverse DNS fails post-chroot, instead of falling through to an
allowed-by-default state.
Why this is just a test
The GHSA fix landed in #5524 (commit
50f389f50), which targets thehosts denydirection with an explicit fail-closed guard inModuleDefinition::permits(). Thehosts allowdirection is alreadystructurally fail-closed because
HostPattern::Hostname(_)::matchesreturns
falsewhen the peer hostname isNone, so a hostname-onlyallow list cannot be satisfied by an unresolvable peer and
permits()returns
falseon the empty-allow-match branch.The existing chunk
module_peer_hostname_resolution_before_chroot_denies_unknowncovers the same property, but it is named for the CVE rather than for
the upstream-testsuite scenario, and pairs poorly with
module_hostname_deny_fails_closed_when_dns_unresolved, which isexplicitly named after Scenario A. This PR adds a Scenario B mirror so
the two upstream-test scenarios are pinned with matching names and
matching docblock structure; future refactors of
permits()cannotaccidentally introduce an allowed-by-default path for the allow-side
without flipping a clearly-labeled regression test.
Upstream reference
clientserver.c(upstream rsync 3.4.3, commitc38f20c5)moves reverse DNS before chroot/setuid so
client_name()returns areal hostname at ACL evaluation time. oc-rsync's module-access path
(
module_access::request.rs::process_module_request()) resolves thehostname before
apply_module_privilege_restrictions()entersthe per-module chroot; the matcher returns
falsewhenever thehostname is
None, so a hostname-onlyhosts allowrule refusesthe connection.
testsuite/daemon-chroot-acl.testScenario B:use chroot = yes+hosts allow = <hostname>+ DNS fail -> refuse.Scope
crates/branding/changes.daemon-tls, DirSandbox, SEND_ZC, or flat arena flist.
#![deny(unsafe_code)]preserved; no clippy waivers.Test plan