Repository navigation
Description
A repo mirrored from a peer is stored with is_public = true and no visibility rules, and sync never replicates the owner's rules. The replication gate on the push path reads that row's own (rules, is_public) pair, so for a mirror with no canonical twin it resolves to allow against an empty rule set and the publish list is built with nothing withheld.
Observed
Running the real publish-list builder twice over the same on-disk repo, changing only the row state:
| row state | announce | objects | includes the blob under /secret/ |
|---|---|---|---|
mirror row, as upsert_mirror_repo creates it |
true | 6 | yes |
same disk and refs, with a /secret/** deny rule |
true | 5 | no |
The withholding itself is correct: with a rule present the blob is excluded. The mirror row's empty rule set is what lets it through. The control matters here, since without it a permissive result proves nothing.
Why the row is hollow
Db::upsert_mirror_repo (crates/gitlawb-node/src/db/mod.rs) binds is_public to true and inserts no rules, and crates/gitlawb-node/src/sync.rs contains no visibility-rule writes at all. Rules attach per physical repo.id, and a mirror's id is the slash form {owner_short}/{name}, so list_visibility_rules returns empty for it. There is no shared rule set to fall back to.
How a mirror comes to hold withheld bytes
resolve_mirror_mode selects a plain full clone when the origin reports no withheld paths. A repo that is fully public when first mirrored is therefore cloned whole, and git does not prune already-fetched objects when the origin later adds a deny rule. Later fetches switch to promisor mode and change nothing about what is already in the object store. The steady state is a mirror holding now-withheld blobs with an empty local rule set and is_public = true, which is exactly the input the gate reads.
Reachability
GITLAWB_ENFORCE_OWNER_PUSH defaults to false, so any authenticated DID can push, and a valid did:key signature is self-asserted. get_repo prefers a canonical row over a mirror, so the exposure needs a mirror with no canonical twin on the node.
Why this is worse than a read leak
The consumer publishes rather than serves. The bytes go to content-addressed networks on the push path, so a CID any peer has fetched cannot be withdrawn. Fixing the gate afterwards does not undo the disclosure.
Where
The receive-pack tail in crates/gitlawb-node/src/api/repos.rs, where list_visibility_rules(&record.id) feeds replication_withheld_set and the listable_at_root(rules, is_public, owner_did, None) decision inside it. Present on main today, so this is not specific to any open branch.
Fix direction
A consumer that publishes cannot re-apply the withholding projection locally, because the rules were never replicated. So it has to either skip mirror rows (the slash-form id test already used elsewhere in the codebase) or resolve the row to a canonical twin and fail closed when none exists. Replicating the owner's visibility state on sync, or defaulting mirrors closed until rules are known, would fix the data-model half instead and close this at the source.
Activity
beardthelion commentedon Nov 17, 2026
The reachability section needs updating.
GITLAWB_ENFORCE_OWNER_PUSHnow defaults to true (config.rs), so an arbitrary signed DID can no longer push to a mirror row. The pusher has to match the row's owner. That lowers the exposure, since the person pushing is the origin's owner, but they are pushing to a node where the origin's rules never arrived, so the publish list is still built with nothing withheld.The gap itself is unchanged.
upsert_mirror_repostill bindsis_publicto true and writes no visibility rules, and sync still never copies the origin's rules. The only quarantine on the mirror path is the iCaptcha propagation gate, which does not look at withheld paths.I have not re-run the publish-list comparison from the issue body against this commit, and I have not checked what owner value a mirror row carries compared with the DID the push gate matches.