Re: [kitten] [nfsv4] rpcsec-gssv3 multi-principal authentication

"J. Bruce Fields" <bfields@fieldses.org> Wed, 03 September 2014 19:49 UTC

Return-Path: <bfields@fieldses.org>
X-Original-To: kitten@ietfa.amsl.com
Delivered-To: kitten@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 109221A6F9E; Wed, 3 Sep 2014 12:49:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.568
X-Spam-Level:
X-Spam-Status: No, score=-2.568 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.668] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3EkmMWm40qND; Wed, 3 Sep 2014 12:49:23 -0700 (PDT)
Received: from fieldses.org (fieldses.org [174.143.236.118]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E10C91A6F92; Wed, 3 Sep 2014 12:49:09 -0700 (PDT)
Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from <bfields@fieldses.org>) id 1XPGYD-00070J-HA; Wed, 03 Sep 2014 15:49:05 -0400
Date: Wed, 03 Sep 2014 15:49:05 -0400
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Nico Williams <nico@cryptonector.com>
Message-ID: <20140903194905.GB25363@fieldses.org>
References: <alpine.GSO.1.10.1407311902230.21571@multics.mit.edu> <9BF7E3EA-59DB-4B91-A27A-659790AED727@netapp.com> <alpine.GSO.1.10.1408030153400.21571@multics.mit.edu> <alpine.GSO.1.10.1408201123060.21571@multics.mit.edu> <alpine.GSO.1.10.1409021306240.21571@multics.mit.edu> <20140903041240.GG2664@localhost> <20140903174741.GA24790@fieldses.org> <CAK3OfOipM10jM=e59q8hZd7niQGinQgWSBVFjKVabKRkvH1HUg@mail.gmail.com> <20140903192855.GA25363@fieldses.org> <CAK3OfOg9KSu7eK8a9zf24gJ92xegJhHvGXX1EEYhuPKE=Q87Vw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CAK3OfOg9KSu7eK8a9zf24gJ92xegJhHvGXX1EEYhuPKE=Q87Vw@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Archived-At: http://mailarchive.ietf.org/arch/msg/kitten/EZ-6GkD4wzvYe0baonMmgPL69bo
Cc: "kitten@ietf.org" <kitten@ietf.org>, "Adamson, Andy" <William.Adamson@netapp.com>, NFSv4 <nfsv4@ietf.org>
Subject: Re: [kitten] [nfsv4] rpcsec-gssv3 multi-principal authentication
X-BeenThere: kitten@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Common Authentication Technologies - Next Generation <kitten.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/kitten>, <mailto:kitten-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/kitten/>
List-Post: <mailto:kitten@ietf.org>
List-Help: <mailto:kitten-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/kitten>, <mailto:kitten-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Sep 2014 19:49:25 -0000

On Wed, Sep 03, 2014 at 02:39:29PM -0500, Nico Williams wrote:
> On Wed, Sep 3, 2014 at 2:28 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> > On Wed, Sep 03, 2014 at 01:32:46PM -0500, Nico Williams wrote:
> >> On Wed, Sep 3, 2014 at 12:47 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> >> > Sorry, I haven't been thinking about this, I'm probably confused, but I
> >> > think I was imagining an attack something like:
> >> >
> >> >         - I, a rogue client, sniff some random krb5 traffic from the
> >> >           user.
> >> >         - That traffic includes at least one (rpc header, mic of rpc
> >> >           header) pair.
> >> >         - I send a CREATE call using that rpc header as the nonce data.
> >> >
> >> > ?
> >>
> >> It almost works, but remember, the server must have the security
> >> context to verify the MIC with, and that context will have to be tied
> >> to the same NFSv4 client ID (same session).
> >
> > Argh, I'm totally confused.
> >
> > Which context (inner or outer) is "the security context" in the above?
> 
> Inner.  The one authenticating the user.
> 
> > So the server will reject my attempt above because the inner context is
> > associated with a different clientid than the outer context?
> 
> Yes: because the inner security context is not known in ... this
> context (English sense of the word).
> 
> > I'm not even sure what it means for a gss context to be tied to a client
> > ID.
> 
> To a session, connection, ...  Maybe I assumed too much about that?
> I'd have to go look at Illumos source to see if maybe I was led astray
> by that.  It's been a while.

A gss context is created by an INIT_SEC_CONTEXT call before it's ever
used with any particular NFS client (do we even know it's necessarily
going to be used for NFS at that point?).

Then it may be used for some NFS RPC call, which may or may not be
associated with a client id.

So I guess you'd want the rules to be that a gss context is either tied
to a client id or not, that the first RPC call referring to some
clientid or sessionid ties the context to a client, at which point it's
forbidden from being associated to any other client, and that only
contexts tied to client id's can be used in CREATE calls?

This all seems a little ad-hoc.  And it mixes up the RPC and NFS layers
in ways I'm not sure I understand.

> > Maybe I'm just dense, but at a minimum I think this needs a much more
> > careful explanation.
> 
> I agree.
> 
> >> Oh, but maybe some servers have a global RPCSEC_GSS context handle?
> >> If so, that would be a problem.  In that case the server could pick
> >> the nonce.  Or the MIC could be taken over more content (e.g., also a
> >> MIC made with the client context).  Just in case, this would be a good
> >> change to make.
> >
> > Fundamentally the (nonce, mic) pair here looks meaningless.  The network
> > is presumably already full of (data, mic(data)) pairs using this
> > context, what does it prove that you can supply me with one when you get
> > to choose the data?
> 
> There should be a bit more structure to it to prevent aliasing, and
> the server could be the source of the nonce (adding a round-trip) or
> we could add more to the message to be MICed (e.g., the client ID).

Sounds like there's work to do.

--b.