Re: [tram] Benjamin Kaduk's No Record on draft-ietf-tram-stunbis-16: (with COMMENT)

Benjamin Kaduk <kaduk@mit.edu> Tue, 15 May 2018 18:52 UTC

Return-Path: <kaduk@mit.edu>
X-Original-To: tram@ietfa.amsl.com
Delivered-To: tram@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 352E912E86D; Tue, 15 May 2018 11:52:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.201
X-Spam-Level:
X-Spam-Status: No, score=-4.201 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 FmdWNAoKOPOi; Tue, 15 May 2018 11:52:28 -0700 (PDT)
Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu [18.7.68.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 820F112E858; Tue, 15 May 2018 11:52:27 -0700 (PDT)
X-AuditID: 12074425-973ff7000000492e-09-5afb2c678b3d
Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id 07.D4.18734.86C2BFA5; Tue, 15 May 2018 14:52:25 -0400 (EDT)
Received: from outgoing.mit.edu (OUTGOING-AUTH-1.MIT.EDU [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id w4FIqIrI030124; Tue, 15 May 2018 14:52:19 -0400
Received: from kduck.kaduk.org (24-107-191-124.dhcp.stls.mo.charter.com [24.107.191.124]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id w4FIqDHm018987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 15 May 2018 14:52:15 -0400
Date: Tue, 15 May 2018 13:52:13 -0500
From: Benjamin Kaduk <kaduk@mit.edu>
To: Marc Petit-Huguenin <petithug@acm.org>
Cc: The IESG <iesg@ietf.org>, tram-chairs@ietf.org, tasveren@rbbn.com, Gonzalo.Camarillo@ericsson.com, draft-ietf-tram-stunbis@ietf.org, tram@ietf.org
Message-ID: <20180515185210.GO2249@kduck.kaduk.org>
References: <152410023763.28841.5479872591399614102.idtracker@ietfa.amsl.com> <facc8bd7-2f14-4960-7d4d-181afb5545f9@acm.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ALfTUftag+2gvp1h"
Content-Disposition: inline
In-Reply-To: <facc8bd7-2f14-4960-7d4d-181afb5545f9@acm.org>
User-Agent: Mutt/1.9.1 (2017-09-22)
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFKsWRmVeSWpSXmKPExsUixG6nopup8zvKoOeMhkXnlstsFpuWr2Sy mPFnIrPFhTV3mSzWL//GbrH850o2iw9rL7A5sHtcvuLt8evrVTaPJUt+MnnsmTOJMYAlissm JTUnsyy1SN8ugSvj+9kFjAX7exgrvlydzt7AeCC3i5GTQ0LARGLjhPWMXYxcHEICi5kkFu54 DeVsZJSYf7SdDcK5yiSx/s9aZpAWFgFViSUT/7GA2GwCKhIN3ZfB4iICWhL7p1xnBmlgFljB KDH3+QxWkISwQJzEvzPP2UFsXgFjiUdrvrOB2EICdRLPnn1nhogLSpyc+QRsKLNAmcSzjh6m LkYOIFtaYvk/DpAwp4C1xJRrp5lAbFEBZYm9fYfYJzAKzELSPQtJ9yyEboiwlsSNfy8xhbUl li18zQxh20qsW/eeZQEj+ypG2ZTcKt3cxMyc4tRk3eLkxLy81CJdC73czBK91JTSTYzgaHJR 3cE456/XIUYBDkYlHt4LN39FCbEmlhVX5h5ilORgUhLltf4DFOJLyk+pzEgszogvKs1JLT7E qAK069GG1RcYpVjy8vNSlUR4M3l/RwnxpiRWVqUW5cOUSXOwKInzCm7+ECUkkJ5YkpqdmlqQ WgSTleHgUJLgldMGahQsSk1PrUjLzClBSDNxcB5ilODgARpuCFLDW1yQmFucmQ6RP8WoKCXO e1ILKCEAksgozYPrBSVBiez9Na8YxYHeEuaNB2nnASZQuO5XQIOZgAYXnfoOMrgkESEl1cBo HpG8bImB1NTHvjvtG07eMHisyhpf/CWEu2KZTOOnr+W5YhPbvk87eXmRypIz7ltsra10n2s2 Ve2SWzIzeMJcJobPceVXl4nlxts+cV5guUJq1iKnPRdmXHEKF2AM1BSZvMngWv97z5rnO/5u log8+bvmsuG7nS8POebP4bCvXfJpj8LFJpMKJZbijERDLeai4kQAUnAT5l0DAAA=
Archived-At: <https://mailarchive.ietf.org/arch/msg/tram/787V6AWhaEh_j1faaNTonfrEbc0>
Subject: Re: [tram] Benjamin Kaduk's No Record on draft-ietf-tram-stunbis-16: (with COMMENT)
X-BeenThere: tram@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "Discussing the creation of a Turn Revised And Modernized \(TRAM\) WG, which goal is to consolidate the various initiatives to update TURN and STUN." <tram.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tram>, <mailto:tram-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tram/>
List-Post: <mailto:tram@ietf.org>
List-Help: <mailto:tram-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tram>, <mailto:tram-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 15 May 2018 18:52:31 -0000

On Wed, May 02, 2018 at 03:20:05PM -0700, Marc Petit-Huguenin wrote:
> Hi Benjamin,
> 
> Thanks for the review, please see my responses inline.

Sorry for the slow reply.

> On 04/18/2018 06:10 PM, Benjamin Kaduk wrote:
> > Benjamin Kaduk has entered the following ballot position for
> > draft-ietf-tram-stunbis-16: No Record
> > 
> [...]
> > 
> > 
> > 
> > ----------------------------------------------------------------------
> > COMMENT:
> > ----------------------------------------------------------------------
> > 
> > I'm balloting No Objection and not DISCUSS because no individual
> > item rises quite to that level of criticality, but there still are
> > quite a number of things that ought to be addressed prior to
> > publication.
> > 
> > In addition to the excellent points raised in the secdir review
> > (which are mostly addressed but only in the editor's copy?), I
> > would call out a few more key observations:
> > 
> > If I understand correctly, the server's PASSWORD-ALGORITHMS array
> > from the response are echoed back by the client in the subsequent
> > request in order to provide downgrade protection -- the initial
> > response is at least sometimes not authenticated, and by having the
> > client repeat it back under an authenticated scheme, the server can
> > detect if the list was tampered to remove any new, stronger,
> > algorithms.  This is probably an important enough concept to be
> > called out explicitly, either where the behavior is described or in
> > Section 9.2.1 ("Bid Down Attack Prevention").usb
> 
> Yes, EKR had a similar question that I still have to answer, and I'll answer both after this review.
> 
> > 
> > Section 8.1 has some text that could be read as requiring a STUN
> > client to implement dual-stack IPv4/IPv6, which presumably is not
> > the intention:
> >    In addition, instead of querying either the A or the AAAA resource
> >    records for a domain name, the client MUST query both and try the
> >    requests with all the IP addresses received, as specified in
> >    [RFC8305].
> 
> New text:
> 
>    In addition, instead of querying either the A or the AAAA resource
>    records for a domain name, a dual-stack IPv4/IPv6 client MUST query
>    both and try the requests with all the IP addresses received, as
>    specified in [RFC8305].

SGTM.

> > 
> > There are still some places where the text talks about
> > MESSAGE-INTEGRITY when it really means "message integrity
> > protection" (i.e., either the SHA1 or SHA-256 variants, for now);
> > I've attempted to note them in the notes below.
> > 
> > There is text in both Sections 9.1 and 9.2 that talks of replay
> > protection being provided, by the time-limited nature of the
> > short-term credentials or the nonce for long-term credentials.  This
> > seems to only, strictly speaking, be true if any given
> > password/nonce can only be used once, but for the short-term
> > credentials the password is used for the duration of the
> > "session-equivalent", and for the long-term credentials a nonce can
> > be reused for some amount of time as well.  So while these are both
> > replay countermeasures that can limit replay attacks, it seems a
> > stretch to claim that they prevent replay attacks (entirely).
> 
> s/prevented/limited/

Thanks :)

> > 
> > The Stale Nonce behavior seems potentially worrisome, in that it
> > opens up a side channel for a distinguishing attack,
> > between a 401 and 438 response.  (That is, "password correct" vs.
> > "password incorrect".)  The impact seems rather muted, though, since
> > the gain to the attacker is to be able to precompute a bunch of
> > requests using a nonce of the attacker's choosing and blindly replay
> > the precomputed object against (possibly multiple) servers looking
> > for a guess.  The realm and username are still in play, so the scope
> > for the attacker to gain from the precomputation seems limited.
> > (The same level of brute-force guessing can be obtained "live" just
> > by computing the trial responses against a live server, using a
> > valid nonce.)  So, while it might be nice to give guidance that 438
> > should only be used when the server can validate that it did
> > generate the nonce and the nonce was valid "recently", and to treat
> > other cases as authentication failures, it's not clear to me that
> > there's enough of a benefit from the change to make it worth doing.
> 
> I am not sure what to do there.

"Nothing" may be the right answer, though I guess there was a touch
more follow-up on this point already.

> > 
> > 
> > Section 6.2.3
> > 
> > Maybe just cite BCP 195/RFC 7525 instead of inlining requirements?
> 
> Already fixed following a previous review.
> 
> > 
> > Also, the "client SHOULD verify ..." and "client MUST verify ..." are
> > similar enough that some clarification of certificate vs. identity
> > verification would be in order, if both statements are believed
> > accurate.
> 
> Changed SHOULD to MUST.

WFM

> > 
> > 
> > Section 6.3
> > 
> >    [...] Known-but-unexpected attributes SHOULD be ignored by
> >    the agent. [...]
> > 
> > Why is this not an error?
> 
> Probably an application of Postel's law but that text was already in RFC 5389 so we cannot change it without breaking compatibility with RFC 5389 implementations.

Ah, agreed about the compatibility implications.

> > 
> > 
> > Section 6.3.1, 6.3.2, etc.
> > 
> > Should the second paragraph start with "Otherwise, "?  Presumably
> > once an error response is sent or processing ceases, processing stops...
> 
> Applied.
> 
> > 
> > 
> > Section 8.1
> > 
> >    [...] A "stuns" URI
> >    containing an IP address MUST be rejected, unless the domain name is
> >    provided by the same mechanism that provided the STUN URI, and that
> >    domain name can be passed to the verification code.
> > 
> > "the verifcation code" is probably unnecessarily vague; we're just
> > talking about the (D)TLS SNI and certifciate verification code,
> > right?
> 
> New text:
> 
>    [...]
>    IP address is used directly to contact the server.  A "stuns" URI
>    containing an IP address MUST be rejected, unless the domain name is
>    provided by the same mechanism that provided the STUN URI, and that
>    domain name can be passed to the (D)TLS SNI and certificate
>    verification code.

WFM.

> > 
> > 
> > 
> > Section 9.2
> > 
> >    [...[ The nonce provides the replay protection.  It is a cookie,
> >    selected by the server, and encoded in such a way as to indicate a
> >    duration of validity or client identity from which it is valid.
> > 
> > Is this like a TLS cookie, where only the server needs to know about
> > the internal structure (viz. "encoded" in the above)?  If so, the
> > text could probably be more clear.
> 
> New text:
> 
>    [...]
>    a nonce.  The nonce provides the replay protection.  It is a cookie,
>    selected by the server, and encoded in such a way as to indicate a
>    duration of validity or client identity from which it is valid.  Only
>    [...]

I think the copy/paste was from the wrong spot, but looking at the
diff, the new text works for me.

> > 
> > When mentioning just "a message-integrity", maybe forward-ref both
> > versions of it to be more clear that we don't mean just the old one?
> 
> New text:
> 
>    [...]
>    the realm, and echoing the nonce provided by the server.  The client
>    also includes one of the message-integrity attributes defined in this
>    document, which provides an HMAC over the entire request, including
>    the nonce.  The server validates the nonce and checks the message
>    [...]

WFM

> > 
> > It's unclear why indications can't use a nonce, if one is known
> > from a previous request/response on the same connection.
> 
> I think that the explanation is clear: "[...] indications cannot be challenged." and as there is no way to know the when a cookie will expire, we cannot risk losing data for that reason.

Okay.

> > 
> > When encoding the value of 0 for the security feature, it may be
> > worth clarifying that it is still encoded as a 24-bit integer and
> > base64-encoded, though the "13 character string" text ought to make
> > this clear to the reader.
> 
> New text:
> 
>    [...]
>    as the less significant bit of the third byte.  If no security
>    features are used, then an integer with all 24 bit set to zero MUST
>    be encoded instead.  For the remainder of this document the term
>    [...]

Okay

> > 
> > 
> > Section 9.2.4
> > 
> >       *  If the request contains neither PASSWORD-ALGORITHMS nor
> >          PASSWORD- ALGORITHM, then the request is processed as though
> >          PASSWORD- ALGORITHM were MD5 (Note that if the original
> >          PASSWORD-ALGORITHMS attribute did not contain MD5, this will
> >          result in a 400 Bad Request in a later step below).
> > 
> > This Note seems a bit odd, since we're predicated on
> > PASSWORD-ALGORITHMS being absent.
> 
> New text:
> 
>       *  If the request contains neither PASSWORD-ALGORITHMS nor
>          PASSWORD-ALGORITHM, then the request is processed as though
>          PASSWORD-ALGORITHM were MD5 (Note that if the PASSWORD-
>          ALGORITHMS attribute is present but does not contain MD5, this
>          will result in a 400 Bad Request in a later step below).

Ah, this makes more sense.

> > 
> >       *  Otherwise, unless (1) PASSWORD-ALGORITHM and PASSWORD-
> >          ALGORITHMS are both present, (2) PASSWORD-ALGORITHMS matches
> >          the value sent in the response that sent this NONCE, and (3)
> >          PASSWORD-ALGORITHM matches one of the entries in PASSWORD-
> >          ALGORITHMS, the server MUST generate an error response with an
> >          error code of 400 (Bad Request).
> > 
> > Maybe we could be more clear about "the value of the
> > PASSWORD-ALGORITHMS attribute in the message matches the value of
> > the PASSWORD-ALGORITHMS attribute sent in the response that sent the
> > NONCE used with this message"?
> 
> I am not sure what to do there.

I think I was trying to propose:

       *  Otherwise, unless (1) PASSWORD-ALGORITHM and PASSWORD-
	  ALGORITHMS are both present, (2) the value of the
	  PASSWORD-ALGORITHMS attribute in this message matches the
	  value of the PASSWORD-ALGORITHMS attribute sent in the
	  response that sent the NONCE used with this message, and
	  (3) PASSWORD-ALGORITHM matches one of the entries in
	  PASSWORD- ALGORITHMS, the server MUST generate an error
	  response with an error code of 400 (Bad Request).

Though I suspect that "this message" has a more appropriate term
that could be used instead.

> > 
> > 
> > Section 9.2.5
> > 
> >    If the response contains a PASSWORD-ALGORITHMS attribute, the
> >    subsequent request MUST be authenticated using MESSAGE-INTEGRITY-
> >    SHA256 only.
> > 
> > This means "all subsequent requests to this server"?  Maybe the
> > wording could be more clear.  (It also means that if we get a new
> > scheme when SHA256 is broken, the document introducing it may need
> > to Update this document to remove the MUST.)
> 
> Fixed.
> 
> > 
> > Also, I think the Security Feature bit is "Password algorithms"
> > plural (in the next paragraph and maybe multiple locations in the
> > document).
> 
> Fixed.
> 
> > 
> > 
> > Section 10
> > 
> >    [...] If the transaction uses TLS or DTLS and if the
> >    transaction is authenticated by a MESSAGE-INTEGRITY-SHA256 attribute
> >    and if the server wants to redirect to a server that uses a different
> >    certificate, then it MUST include an ALTERNATE-DOMAIN attribute
> >    containing the subjectAltName of that certificate.
> > 
> > The (definite article), implying the entire subjectAltName?  Or just
> > one name that is contained as a SAN entry?
> 
> New text:
> 
>    [...]
>    or practical.  If the transaction uses TLS or DTLS and if the
>    transaction is authenticated by a MESSAGE-INTEGRITY-SHA256 attribute
>    and if the server wants to redirect to a server that uses a different
>    certificate, then it MUST include an ALTERNATE-DOMAIN attribute
>    containing the name contained in the subjectAltName of that
>    certificate.  The test on the MESSAGE-INTEGRITY-SHA256 attribute
>    [...]

I think "a name contained in the subjectAltName of that certificate"
is the expected meaning ("the" --> "a"), since SAN can be
multi-valued.

> > 
> > 
> > Section 14.8
> > 
> > Need to not just say MESSAGE-INTEGRITY since the SHA256 variant
> > should be fine as well.
> 
> Fixed.
> 
> > 
> > 
> > Section 14.10
> > 
> > Maybe the nonce cookie should get a shout-out here?
> 
> Not sure, as when using stunbis with RFC 5389, the nonce cookie will not be present.

Even "in some cases, this value will include a 'nonce cookie' as
defined previously in the document" might be useful, but I'll defer
to your judgment.

> > 
> > 
> > Section 14.12
> > 
> > Do we need to talk about the padding, since this is the the sole
> > contents of the attribute and the attribute padding suffices?
> 
> Added similar text that was added to 14 about setting the padding bits to zero.

Thanks

> > 
> > Also, "derive the long-term password" doesn't seem quite right;
> > we're deriving the key from the long-term password, per Section
> > 17.15.1.
> 
> New text:
> 
>    The PASSWORD-ALGORITHM attribute is present only in requests.  It
>    contains the algorithms that the server must use to derive a key from
>    the long-term password.

SGTM

> > 
> > 
> > Section 15.1.2
> > 
> >    There is no amplification of the number of packets with this attack
> >    (the STUN server sends one packet for each packet sent by the
> >    client), though there is a small increase in the amount of data,
> >    since STUN responses are typically larger than requests.
> > 
> > I usually hear amplification in terms of bytes or bandwidth, not
> > packets.  So maybe just "amplification is modest"?
> 
> That text is unchanged from RFC 5389.  Additionally the text says that "[...]there is a small increase in the amount of data,"

I don't think that faithfulness to RFC 5389 need apply here (this is
a full-fledged 'bis' version), but I also don't insist on any
change; it's a very minor issue.

> > 
> > 
> > Section 15.3
> > 
> >    This specification uses both HMAC-SHA1 and HMAC-SHA256 for
> >    computation of the message integrity.
> > 
> > Could perhaps be reworded, since the number of situations when both
> > are used on the same message is small, and we try to push SHA256
> > when we can.
> 
> New text:
> 
>    This specification uses both HMAC-SHA256 for computation of the
>    message integrity, sometimes in combination with HMAC-SHA1.  If, at a
>    [...]

"both" seems out of place, now.

> > 
> >    o  STUN Client and Server using the Short Term Credential Mechanism
> > 
> > Clients and Servers, plural.
> 
> Fixed.
> 
> > 
> > 
> > Section 17.32.
> > 
> > I'm confused why we have MUST-level requirements about using
> > PASSWORD-ALGORITHMS when it is in the comprehension-optional range
> > (e.g., echoing from response to repeated request as in Section
> > 9.2.5).  The server cannot actually enforce this MUST when talking
> > to an old client if we want to retain the comprehension-optional
> > semantics, IIUC.
> 
> It is comprehension-optional so old clients does not break.  But old client MUST process them (comprehension-optional doe snot mean that processing them is optional, but that an agent should not fail when seeing them and not understanding them).

Probably I was just confused on my first read, sorry about that.
(A client *implementing this spec* MUST echo PASSWORD-ALGORITHMS
when generating a new request after an error response, but of course
older clients don't implement this spec.)

> > 
> > 
> > Section 17.6
> > 
> > If we're adding support for DTLS-over-udp (per the next section),
> > should we be registering stuns/udp?
> 
> Adam explained why it is not needed.
> 
> > 
> > "password encryption algorithm" is not quite the right statement to
> > make, since we're hashing, not encrypting.
> > 
> 
> I am not what this is about, as these words are not used in this section (or in the whole document).

I see "password encryption algorithm" in the "Changes since RFC
5389" section, even in the -18.


Thanks for all the explanations and updates!

Benjamin