All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jan Engelhardt <jengelh@inai.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] http-backend: CGI error messages need to be output on stdout
Date: Wed, 01 Dec 2021 23:31:49 -0800	[thread overview]
Message-ID: <xmqqk0gnwjh6.fsf@gitster.g> (raw)
In-Reply-To: <20211202001238.21808-1-jengelh@inai.de> (Jan Engelhardt's message of "Thu, 2 Dec 2021 01:12:37 +0100")

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.

      parent reply	other threads:[~2021-12-02  7:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  0:12 [PATCH 1/2] http-backend: CGI error messages need to be output on stdout Jan Engelhardt
2021-12-02  0:12 ` [PATCH 2/2] http-backend: give a hint that web browser access is not supported Jan Engelhardt
2021-12-02  7:31 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqk0gnwjh6.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jengelh@inai.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.