Repository navigation
Description
Problem
Serving reads on a promisor mirror can start a lazy fetch from the peer, and that fetch runs with the node process's ambient git configuration. read_object_content_bounded and batch_check_probe (crates/twigpine-node/src/git/store.rs) call run_bounded_git_raw, which inherits the environment, including GIT_CONFIG_GLOBAL/HOME and the operator's global git config. A missing object in a promisor mirror makes git cat-file fetch from the mirror's peer origin, so a proxy or redirect setting in the operator's global config applies to a request whose URL a peer chose.
On main the lazy fetch also carries no address pin and no hardening of its own. #612 writes the generic hardening (blank http.proxy, remote.origin.proxy, followRedirects=false, the curloptResolve pin) into each mirror's own config. A URL-scoped key such as http.<peer-url>.followRedirects or http.<peer-url>.proxy in the global config still outranks a generic local key, so the operator-config channel stays open after #612.
Reachability
A peer controls its URL and the objects it withholds, and any reader can trigger a lazy fetch through a serving read of a missing object. The override itself needs a setting the operator wrote into the service account's git config. A peer cannot create that setting.
Evidence
A throwaway test on main (17395b4f) called read_object_content_bounded on a promisor mirror whose origin is a loopback listener, with GIT_CONFIG_GLOBAL pointing at a config file:
CONTROL no global config: peer_hits=3 proxy_hits=0
URL-SCOPED global proxy: peer_hits=0 proxy_hits=3
GENERIC global proxy: peer_hits=0 proxy_hits=3
The same calls through run_bounded_git_raw_isolated_https gave proxy_hits=0 in all three cases. The control row also shows the serving read dialing the peer's URL directly, which is the unpinned lazy fetch that #612 addresses.
Severity
P3. The bypass needs operator-authored git config. With #612 merged, only URL-scoped keys still get through.
Possible direction
- Run lazy-fetch-capable serving reads through
run_bounded_git_raw_isolated_https, which clears the environment and setsGIT_CONFIG_GLOBAL=/dev/null. Verified above: it removes the operator-config channel. The mirror's own config still applies. - Or disable implicit lazy fetch on serving reads and fetch missing objects through the checked sync transport.
Which one is right depends on whether serving reads should ever fetch withheld objects at all.
Related
#612 persists the generic hardening into each mirror's config and leaves this channel as a follow-up.
Activity