public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zack@codesourcery.com>
To: gcc@gcc.gnu.org
Subject: Re: source mgt. requirements solicitation
Date: Mon, 09 Dec 2002 17:50:00 -0000	[thread overview]
Message-ID: <87isy2ir3b.fsf@egil.codesourcery.com> (raw)
In-Reply-To: <20021209.164325.21937095.wlandry@ucsd.edu> (Walter Landry's message of "Mon, 09 Dec 2002 16:43:25 -0800 (PST)")


I'm keeping around a lot of context.  Scroll down.

>> > > 0d. The data stored in the repository cannot be modified by
>> > >     unprivileged local users except by going through the version
>> > >     control system.  Presently I could take 'vi' to one of the ,v
>> > >     files in /cvs/gcc and break it thoroughly, or sneak something into
>> > >     the file content, and leave no trace.
>> > 
>> > There is no interaction with root, so if you own the archive, you can
>> > always do what you want.  To get anything approaching this, you have
>> > to deal with PGP signatures, SHA hashes, and the like.  OpenCM is
>> > probably the only group (including BitKeeper) that even comes close to
>> > doing this right.
>> 
>> This sort of thing has been done simply by a modified setuid (to a cvs
>> user, not root) cvs binary so users can't access the repository directly,
>> only through that binary.  More generically, with a reasonable protocol
>> for local repository access it should be possible to use GNU userv to
>> separate the repository from the users.
>
> This is a different security model.  Arch is secure because it doesn't
> depend on having priviledged access.  For example, there is an "rm
> -rf" command built into arch.
>
> I have a feeling that you are thinking of how CVS handles things, with
> a centralized server.  Part of the whole point of arch is that there
> is no centralized server.  So, for example, I can develop arch
> independently of whether Tom thinks that I am worthy enough to do so.
> I can screw up my archive as much as I want (and I have), and Tom can
> be blissfully unaware.  Easy merging is what makes this possible.
>
> So you don't, in general, have a repository that is writeable by more
> than one person.

Let me be specific about the problem I'm worried about.

As Joseph pointed out, GCC development is and will be centered around
a 'master' server.  If we wind up using a distributed system,
individual developers will take advantage of it to do offline work,
but the master repository will still act as a communication nexus
between us all, and official releases will be cut from there.  I doubt
anyone will do releases except from there.[1]  The security of this
master server is mission-critical.

The present situation, with CVS pserver enabled for read-only
anonymous access, and write privilege available via CVS-over-ssh, has
two potentially exploitable vulnerabilities that should be easy to
address in a new system.

_Imprimis_, the CVS pserver requires write privileges on the CVS
repository directories, even if it is providing only read access.
Therefore, if the 'anoncvs' user is somehow compromised -- for
instance, by a buffer overflow bug in the pserver itself -- the
attacker could potentially modify any of the ,v files stored in the
repository.  This was what I was talking about with my point 0c.  It
sounds like all the replacements for CVS have addressed this, by
allowing the anoncvs-equivalent server process to run as a user that
doesn't have OS-level write privileges on the repository.

_Secundus_, CVS-over-ssh operates by invoking 'cvs server' on the
repository host -- running under the user ID of the invoker, who must
have an account on the repository host.  It can't perform any
operations that the invoking user can't.  Which means that the
invoking user must also have OS-level write privileges on the
repository.  Now, such users are _supposed_ to be able to check in
changes to the repository, but they _aren't_ supposed to be able to
modify the ,v files with a text editor.  The distinction is crucial.
If the account of a user with write privileges is compromised, and
used to check in a malicious change, the version history is intact,
the change will be easily detected, and we can simply back out the
malice. If the account of a user with write privileges is compromised
and used to hand-edit a malicious change into a ,v file, it's quite
that this will go undetected until after half the binaries on the
planet are untrustworthy.  It is this latter scenario I would like to
be impossible.

There are several possible ways to do that.  One way is the way
Perforce does it: _all_ access, even local access, goes through p4d,
and p4d can run under its own user ID and be the only user ID with
write access to the repository.  Another way, and perhaps a cleverer
one, is OpenCM's way, where the (SHA of) the file content is the
file's identity, so a malicious change will not even be picked up.
(Please correct me if I misunderstand.)  Of course, that provides no
insulation against an attacker using a compromised account to execute
"rm -fr /path/to/repository", but *that* problem is best solved with
backups, because a disk failure could have the same effect and there's
nothing software can do about that.

zw

  parent reply	other threads:[~2002-12-10  1:46 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-08  7:13 on reputation and lines and putting things places (Re: gcc branches?) Robert Dewar
2002-12-08 14:18 ` source mgt. requirements solicitation Tom Lord
2002-12-08 14:56   ` DJ Delorie
2002-12-08 15:02     ` David S. Miller
2002-12-08 15:45       ` Bruce Stephens
2002-12-08 16:52         ` David S. Miller
2002-12-08 15:11     ` Bruce Stephens
2002-12-08 16:24       ` Joseph S. Myers
2002-12-08 16:47         ` Tom Lord
2002-12-08 22:20           ` Craig Rodrigues
2002-12-08 16:09   ` Phil Edwards
2002-12-08 19:13     ` Zack Weinberg
2002-12-09 10:33       ` Phil Edwards
2002-12-09 11:06       ` Joseph S. Myers
2002-12-09  9:42         ` Zack Weinberg
2002-12-09 11:00           ` Jack Lloyd
2002-12-09 15:10     ` Walter Landry
2002-12-09 15:27       ` Joseph S. Myers
2002-12-09 17:05         ` Walter Landry
2002-12-09 17:10           ` Joseph S. Myers
2002-12-09 18:27             ` Walter Landry
2002-12-09 19:16               ` Joseph S. Myers
2002-12-10  0:27                 ` Zack Weinberg
2002-12-10  0:41                   ` Tom Lord
2002-12-10 12:05                   ` Phil Edwards
2002-12-10 19:44                   ` Mark Mielke
2002-12-10 19:57                     ` David S. Miller
2002-12-10 20:02                       ` Phil Edwards
2002-12-10 23:07                         ` David S. Miller
2002-12-11  6:31                           ` Phil Edwards
2002-12-14 13:43                   ` Linus Torvalds
2002-12-14 14:06                     ` Tom Lord
2002-12-14 17:44                       ` Linus Torvalds
2002-12-14 19:45                         ` Tom Lord
2002-12-14 14:41                     ` Neil Booth
2002-12-14 15:47                       ` Zack Weinberg
2002-12-14 15:33                     ` Momchil Velikov
2002-12-14 16:06                       ` Linus Torvalds
2002-12-15  3:59                         ` Momchil Velikov
2002-12-15  8:26                         ` Momchil Velikov
2002-12-15 12:02                           ` Linus Torvalds
2002-12-15 14:16                             ` Momchil Velikov
2002-12-15 15:20                               ` Pop Sébastian
2002-12-15 16:09                                 ` Linus Torvalds
2002-12-15 16:49                                   ` Bruce Stephens
2002-12-15 16:59                                     ` Linus Torvalds
2002-12-15 18:10                                       ` Bruce Stephens
2002-12-16  8:32                                       ` Diego Novillo
2002-12-17  3:36                                         ` Pop Sébastian
2002-12-17 13:14                                           ` Tom Lord
2002-12-17 15:28                                             ` Itching and scratching (Re: source mgt. requirements solicitation) Stan Shebs
2002-12-17 16:07                                               ` Tom Lord
2002-12-17 15:46                                                 ` Stan Shebs
2002-12-16 17:22                                   ` source mgt. requirements solicitation Mike Stump
2002-12-15 17:09                         ` Stan Shebs
2002-12-09 17:50           ` Zack Weinberg [this message]
2002-12-11  1:11         ` Branko Čibej
2002-12-08 18:32   ` Joseph S. Myers
2002-12-11  2:48     ` Branko Čibej
2002-12-12  6:43 Robert Dewar
2002-12-14 20:16 Nathanael Nerode
2002-12-14 21:34 ` Linus Torvalds
2002-12-15 18:29 Nathanael Nerode
2002-12-18  9:06 Robert Dewar
2002-12-18  9:07 Robert Dewar
2002-12-18  9:48 ` Linus Torvalds
2002-12-18 10:11   ` Phil Edwards
2002-12-18  9:22 Robert Dewar
2002-12-18  9:35 Robert Dewar
2002-12-18  9:58 Robert Dewar
2002-12-18 17:33 Robert Dewar

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=87isy2ir3b.fsf@egil.codesourcery.com \
    --to=zack@codesourcery.com \
    --cc=gcc@gcc.gnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).