Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(node): harden and pin the sync worker's git clone and fetch
The sync worker ran git clone and git fetch against the raw peer URL with no
redirect, proxy or address limits. A peer announcing a name that resolves to
loopback or a cloud-metadata address was refused by the HTTP client and then
reached anyway by git, and a peer at a public address could redirect git to an
internal URL. A URL like http://a.example\@127.0.0.1:1/x is read by the Rust
URL parser as host a.example but dialed by git as 127.0.0.1.

Parse the peer URL once, refuse userinfo, backslashes, fragments, queries and
any scheme but http or https, and give git only the canonical URL plus the
repo path. Resolve a hostname through the resolver policy, refuse the peer
when any answer is non-public, and pin the checked addresses with
http.curloptResolve. Run git with redirects and proxies off, credential and
header resets, protocol limits, and the ambient git config scrubbed, passed as
environment config. Require git 2.31 or newer, and 2.37 or newer for a
hostname origin, and refuse when the version cannot be read. Local-path tests
use a test-only constructor with no hardening.
  • Loading branch information
beardthelion committed Nov 18, 2026
commit e4bf787fbb87e1c29f59611f8ff51d30455d4405
Loading