git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: git-daemon is insecure? (was: [RFC] Secure central repositories)
Date: Sun, 27 Jan 2008 19:16:55 -0500	[thread overview]
Message-ID: <20080128001655.GY24004@spearce.org> (raw)
In-Reply-To: <7vsl0ix4gh.fsf@gitster.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> wrote:
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> > This change allows any repository owner to setup a git-daemon
> > that other users on the same host can connect through to perform
> > upload-pack or receive-pack.
> 
> My reading of this is that it creates a backdoor for people who
[...]
> In addition to having to worry about
> the in-repo data properly being protected from people outside
> the group, you now need to worry about the access through that
> backdoor does not extend outside of the repository.  E.g. the
> repository owner's $HOME that is outside the repository would be
> writable that owner, but is not meant to be accessible by
> project participants.  If you allow others to "run as" you, the
> only thing that forbids that process running as you from
> accessing $HOME is an additional audit of git-daemon and the
> programs it spawns.

So you are partially suggesting that git-daemon isn't thought to
be secure, and that anything readable by the user that git-daemon
is running as is fully exposed to the public Internet.  So the
access control attempts relating to --base-path or the check for
git-daemon-export-ok shouldn't really be trusted or relied upon.

If that really is the case, perhaps git-daemon should be audited
and hardened further.  Last I checked, we encouraged people to run
it to offer anonymous access to repositories, and the documentation
suggests there are publishing access controls that actually work.
If those controls cannot be trusted then we shouldn't encourage
running git-daemon on untrusted networks.


With regards to this patch, yes, you can export your entire $HOME
and maybe expose things you shouldn't or didn't want to.  But even
without git installed you could do this:

	cp /bin/bash /tmp/be-like-mike
	chown $USER /tmp/be-like-mike
	chmod 777 /tmp/be-like-mike
	chmod u+s /tmp/be-like-mike
	wall "try out /tmp/be-like-mike today"

but why would anyone do something that foolish?  UNIX provides the
tools to do this, because there are cases where it can be useful,
but really, you have to be nuts to export all of $HOME.

-- 
Shawn.

  reply	other threads:[~2008-01-28  0:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-27 10:39 [RFC] Secure central repositories by UNIX socket authentication Shawn O. Pearce
2008-01-27 14:04 ` Johannes Schindelin
2008-01-27 17:32   ` Shawn O. Pearce
2008-01-27 18:51     ` Johannes Schindelin
2008-01-28  0:54       ` Shawn O. Pearce
2008-01-28  8:14     ` Dmitry Potapov
2008-01-27 22:56 ` Junio C Hamano
2008-01-28  0:16   ` Shawn O. Pearce [this message]
2008-01-28  3:00     ` git-daemon is insecure? Junio C Hamano
2008-01-28  3:20       ` Shawn O. Pearce
2008-01-28  0:47   ` [RFC] Secure central repositories by UNIX socket authentication Shawn O. Pearce
2008-01-28  7:25     ` Junio C Hamano
2008-01-28  7:51       ` Shawn O. Pearce
2008-01-28 14:23         ` Asheesh Laroia
2008-01-29  3:11           ` Shawn O. Pearce
2008-01-28  7:56       ` Shawn O. Pearce
     [not found] <1201481268.12DFA67D@ea27.dngr.org>
2008-01-28  0:54 ` git-daemon is insecure? (was: [RFC] Secure central repositories) Kate Rhodes

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=20080128001655.GY24004@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).