Re: [kitten] [nfsv4] draft-ietf-nfsv4-rpcsec-gssv3: request for review

Benjamin Kaduk <kaduk@MIT.EDU> Sun, 03 August 2014 06:04 UTC

Return-Path: <kaduk@mit.edu>
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 C35A21A0179; Sat, 2 Aug 2014 23:04:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.202
X-Spam-Level:
X-Spam-Status: No, score=-4.202 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] 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 DCRyPxiVEs5n; Sat, 2 Aug 2014 23:04:38 -0700 (PDT)
Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu [18.9.25.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6B6EF1A0176; Sat, 2 Aug 2014 23:04:38 -0700 (PDT)
X-AuditID: 1209190c-f79ef6d000005dd6-1f-53ddd0f5055e
Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 2D.59.24022.5F0DDD35; Sun, 3 Aug 2014 02:04:37 -0400 (EDT)
Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s7364Z5e007971; Sun, 3 Aug 2014 02:04:36 -0400
Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s7364WYF028311 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 3 Aug 2014 02:04:34 -0400
Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id s7364WGl028341; Sun, 3 Aug 2014 02:04:32 -0400 (EDT)
Date: Sun, 03 Aug 2014 02:04:31 -0400
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: "Adamson, Andy" <William.Adamson@netapp.com>
In-Reply-To: <9BF7E3EA-59DB-4B91-A27A-659790AED727@netapp.com>
Message-ID: <alpine.GSO.1.10.1408030153400.21571@multics.mit.edu>
References: <DC941FEB-725A-49E1-8C38-FF765454827C@netapp.com> <20140730163006.GG26316@fieldses.org> <alpine.GSO.1.10.1407311902230.21571@multics.mit.edu> <9BF7E3EA-59DB-4B91-A27A-659790AED727@netapp.com>
User-Agent: Alpine 1.10 (GSO 962 2008-03-14)
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-691950968-1407045871=:21571"
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnleLIzCtJLcpLzFFi42IR4hTV1v164W6wwd59AhYvpkRZHN28isVi 9vtHrBbTF1k5sHhsmNrE5rFkyU8mjxmfvrAFMEdx2aSk5mSWpRbp2yVwZXzv28JU8EO14nXn RZYGxktyXYycHBICJhL3V7xng7DFJC7cWw9kc3EICcxmkth26DErhLOBUeL8qgcsEM5BJomV Bw4xdTFyADn1ErvneoN0swhoSZw9/ZwZxGYTUJGY+WYjG0iJiICBxMalqiBhZoEiicVbf7GC 2MICbhLNr36BlXMK2Ek8m93CBGLzCjhK3DqzBmrvaUaJpiPn2UESogI6Eqv3T2GBKBKUODnz CQvIfGaBAIlTq00nMArOQpKZhZCZBbbZVmLV2t2MELa2xP2bbWwLGFlWMcqm5Fbp5iZm5hSn JusWJyfm5aUW6Rrq5WaW6KWmlG5iBIe7JM8OxjcHlQ4xCnAwKvHwKuy9GyzEmlhWXJl7iFGS g0lJlPfnLqAQX1J+SmVGYnFGfFFpTmrxIUYJDmYlEd4v2UA53pTEyqrUonyYlDQHi5I471tr q2AhgfTEktTs1NSC1CKYrAwHh5IEb+B5oEbBotT01Iq0zJwShDQTByfIcB6g4X4gNbzFBYm5 xZnpEPlTjIpS4rxLzwElBEASGaV5cL2wdPSKURzoFWHeaJB2HmAqg+t+BTSYCWhwjeFtkMEl iQgpqQZG03cfJnu0vmXZUMk1L/Tb5LXH7xU+3pT/3jup84if26o961LMGmUOSx8ISF7/QOhS w6K+sGczg5/u6jjUxHxrcYK5SbRrXK3x9f19HaYZqlz9vH0dt+LvLfSodVuxZoOv8qv81PSJ BQ1RD46lzPh+7dT5pcreCZqNU06+Er6bUznh2o7fEs5TlFiKMxINtZiLihMBVfR/7iIDAAA=
Archived-At: http://mailarchive.ietf.org/arch/msg/kitten/52ekwOefQlryBkYNexRyDwljSCA
Cc: "J. Bruce Fields" <bfields@fieldses.org>, "kitten@ietf.org" <kitten@ietf.org>, NFSv4 <nfsv4@ietf.org>
Subject: Re: [kitten] [nfsv4] draft-ietf-nfsv4-rpcsec-gssv3: request for review
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: Sun, 03 Aug 2014 06:04:41 -0000

On Fri, 1 Aug 2014, Adamson, Andy wrote:

>
> On Jul 31, 2014, at 7:10 PM, Benjamin Kaduk <kaduk@MIT.EDU> wrote:
>
>> On Wed, 30 Jul 2014, J. Bruce Fields wrote:
>>
>>
>>> The RPCSEC_GSS_CREATE request should demonstrate that the caller knows
>>> both parent and child's credentials.  That's easy for the parent since
>>> an RPCSEC_GSS_CREATE request is also just an ordinary RPCSEC_GSS request
>>> sent as the parent.
>>>
>>> For the child the caller has to calculate the mic of a nonce using the
>>> child context, but as far as I can tell the choice of nonce is entirely
>>> up to the caller.
>>>
>>> Couldn't it then just choose as the nonce some data that it had
>>> previously seen a mic for?  If so, would it work to remove the nonce and
>>> instead calculate, say, a mic of the rpc header (as we do when
>>> calculating the verifier?).
>>
>> Certainly it would help to include (something with) the sequence 
>> number, as a proof of "liveness".  We may have to brainstorm a bit.
>
> I have always thought of Multi-principal authentication in terms of it’s 
> use in NFSv4.2 Inter server to server copy, where all of the 
> RPCSEC_GSS_CREATE messages MUST use rpc_gss_svc_privacy’…. Good catch 
> Bruce.
>
> So for this attack to occur the rgmp_nonce must be re-used by the same 
> rgmp_handle (same user-principal). Insisting on using a random number 
> generator to create nounce could be by-passed by a bad implementation...
>
> Bruces suggestion of using the new reply verifier data (rpc-header) 
> should do the trick. Any objections to this approach?
>
>>
>>> The reply is already authenticated as
>>> the parent, the problem again is authenticating as the child
>
> You must mean the Multi-principal “inner” handle.
>
> There is no “child’ as the child handle is the result of the successful 
> RPCSEC_GSS_CREATE call, and we are defining how success is determined.
>
>
>>> , so I think
>>> it should be calculating a mic using the child context (maybe over the
>>> header data again, as in section 2.3?).
>
> The child handle is varified on the target (server) by a successful 
> GSS_VerifyMIC using the user-principal GSS context and the nounce. This 
> exchange is the target
>>
>
>> In particular, the server could decline to validate the nonce-MIC at 
>> all, and grant access to anyone who claimed to be the user; we must 
>> trust that it does the verification properly.  (A proper verification 
>> confirms that the server does have a valid context handle for the inner 
>> context.)
>
> Correct, and that verification is noted in the sentence prior to the 
> quote above - this obviously could be clearer. I could separate the two 
> verifications into two paragraphs.
>
>   The target verifies the multi-principal authentication by verifying
>   the rgmp_nouce_mic.

I'm not sure we're all on the same page about the concerns about the 
"inner" RPCSEC context handle of the multi-principal authentication.

If I understand correctly, the child RPCSEC contex handle will use the 
same GSS context as the parent RPCSEC context handle (i.e., using the 
host's credentials, not the user's credentials).  This means that when 
creating the child RPCSEC context, there must be some proof that the RPC 
client controls the GSS context corresponding to the inner RPCSEC context 
handle, since the child RPCSEC context will perform operations acting as 
the user specified by the GSS context of the inner RPCSEC context.

My reading of the current draft is that the only attempt to do this is by 
presenting a random nonce and a GSS_GetMIC of that nonce, created using 
the GSS context of the inner RPCSEC context.  The server must verify that 
the MIC is a valid mic, but I do not see any other binding to this GSS 
context.  In particular, the nonce+MIC could be eavesdropped on the wire, 
and inserted into an attacker's RPCSEC_GSS_CREATE call, where the attacker 
provides its own parent RPCSEC context but does not actually have an inner 
context at all.  The attacker can reuse the valid nonce+MIC that it has 
intercepted, which will validate correctly on the server, and the server 
will issue a child RPCSEC context that acts as the user indicated by the 
GSS context of the inner RPCSEC context but uses the key material from the 
attacker's GSS context.

-Ben