Skip to content

Upstream mirror DNS pin is ignored on libcurl older than 7.75 #619

Open

Description

@beardthelion

Problem

The upstream mirror worker pins the checked addresses with http.curloptResolve in the form +host:port:addrs (crates/twigpine-node/src/upstream_mirror.rs, the curlopt_resolve value). The leading + (an entry that times out) was added in libcurl 7.75.0. An older libcurl reads the + as part of the hostname, so the entry never matches the real host. libcurl then resolves the host through ordinary DNS at connect time, and the checked answer set is not the connect set.

The worker's Git floor is 2.37, which does not imply libcurl 7.75. Rocky Linux 8 ships Git 2.43.7 with libcurl 7.61.1, for example.

Reachability

The upstream mirror worker is off by default. When enabled, the repo owner chooses the upstream URL. An owner who controls that hostname's DNS can return a checked public answer to the worker's lookup and a different answer when libcurl resolves it again. That reopens the rebinding window the pin exists to close, on any host whose libcurl is older than 7.75.

Evidence

In rockylinux:8 (git 2.43.7, libcurl 7.61.1), git -c http.curloptResolve=<pin> ls-remote http://pinned.invalid:<port>/x against a loopback listener:

pin='+pinned.invalid:P:127.0.0.1'            hits=0  Could not resolve host: pinned.invalid
pin='pinned.invalid:P:127.0.0.1'             hits=1
pin='pinned.invalid:P:127.0.0.2,127.0.0.1'   hits=1
pin='+pinned.invalid:P:127.0.0.2,127.0.0.1'  hits=0  Could not resolve host: pinned.invalid

With the +, the pin is ignored and git falls back to DNS. Without it, the pin is honored, including the comma-separated address list (libcurl 7.59.0+). On libcurl 8.5.0 both forms are honored, so the failure only shows on an old libcurl.

Severity

P2. This is a trust-boundary bypass of the DNS pin, limited to deployments that enable the upstream mirror on a host with libcurl older than 7.75.

Possible direction

Drop the + prefix. #612 does this for the sync worker's peer pin. The remedy is verified on libcurl 7.61.1 above.

Related

#612 drops the + from the sync worker's peer pin and leaves upstream_mirror.rs unchanged.

Activity

  1. added
    sev:mediumDegraded but workaround exists
    kind:securityVulnerability fix or hardening
    crate:nodegitlawb-node — the serving node and REST API
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate:nodegitlawb-node — the serving node and REST APIkind:securityVulnerability fix or hardeningsev:mediumDegraded but workaround existssubsystem:replicationMirror, replica, and cross-node sync

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions