git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] http: handle absolute-path alternates from server root

From
Jeff King <peff@peff.net>
Date
May 13, 2026, 18:58 UTC
Message-ID
<20260513185825.GB147423@coredump.intra.peff.net>
In-Reply-To
<xmqqo6ikjeqp.fsf@gitster.g>
On Wed, May 13, 2026 at 10:10:54AM +0900, Junio C Hamano wrote:
Show 21 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> >           ... Probably in a way that makes it totally invalid, but
> >           if you were very unlucky you could turn something like:
> >
> >              http://victim.com.evil.domain:8000
> >
> >           into:
> >
> >             http://victim.com
> >
> > 	  Which looks like the start of a redirect attack, except that
> > 	  the attacker could just have written "http://victim.com" in
> > 	  the first place! Either way we feed it to
> > 	  is_alternate_allowed(), which is where we check redirect and
> > 	  protocol rules.
> 
> Yuck.  I know I am the guilty party who introduced the dumb HTTP
> walker but I wish we could kill it off after all these years. I did
> not even recall that we supported the alternate object store in the
> "protocol" until I saw this patch X-<.

Me too. It's been the source of many obscure bugs, and I think a couple of vulnerabilities (even though clients never intend to use dumb clones in the first place).

We talked about dropping it a few years ago, but Eric countered that dumb clones are easier on the server in some cases (like gigantic public-inbox repos that are packed to keep most of the old history in one big pack that is never updated). The verbatim pack-reuse feature tries to get smart clones closer to that, but it's hard to beat serving a static file from the server's perspective. I haven't measured anything in that area in a while, though.

-Peff
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 3 of 7 in “http: handle absolute-path alternates from server root”
  1. http: handle absolute-path alternates from server rootJeff King, May 12, 2026
  2. Junio C HamanoMay 13, 2026
  3. Jeff KingMay 13, 2026
  4. Patrick SteinhardtMay 15, 2026
  5. Jeff KingMay 15, 2026
  6. Patrick SteinhardtMay 21, 2026
  7. Jeff KingMay 22, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.