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

Re: [PATCH 1/2] http-backend: CGI error messages need to be output on stdout

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 2, 2021, 07:31 UTC
Message-ID
<xmqqk0gnwjh6.fsf@gitster.g>
In-Reply-To
<20211202001238.21808-1-jengelh@inai.de>
Jan Engelhardt <jengelh@inai.de> writes:
> Accessing a clone-only URL with a browser would always show a blank
> page, because the reason string "Request is not supported" was
"is not supported" -> "not supported", I think.
> sent to the wrong file descriptor.

I looked at the messages given to not_found() and forbidden(). Most of them do look like they are meant to be given to the remote user, but some reveal the server side paths, and I am reluctant to judge the security implication to start giving them, which have been hidden so far, to the remote users.

I am not sure how strictly it is enforced these days, but at least in early days we were fairly paranoid and aimed to make sure that a remote user cannot tell a repository that does not exist from a repository that the user does not have access to by throwing random requests at the server.

http-backend.c:161:		forbidden(hdr, "Unsupported service: getanyfile");
This one should be safe, I would think.
http-backend.c:184:		not_found(hdr, "Cannot open '%s': %s", p, strerror(errno));

The 'p' is a path to a file in the repository like 'objects/alternates', that is ready to be given to open(2), so it clearly leaks the path on the server.

http-backend.c:260: forbidden(hdr, "Unsupported service: '%s'", name); http-backend.c:271: forbidden(hdr, "Unsupported service: '%s'", name); http-backend.c:278: forbidden(hdr, "Service not enabled: '%s'", svc->name);

These I think should be benign, but I have to admit that I didn't think too deep about them.

Previous: Jan Engelhardt
Message 3 of 3 in “http-backend: CGI error messages need to be output on stdout”
  1. 1/2 http-backend: CGI error messages need to be output on stdoutJan Engelhardt, Dec 2, 2021
  2. 2/2 http-backend: give a hint that web browser access is not supportedJan Engelhardt, Dec 2, 2021
  3. Junio C HamanoDec 2, 2021

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.