Re: [IPsec] AD review of draft-ietf-ipsecme-qr-ikev2-08

Benjamin Kaduk <kaduk@mit.edu> Tue, 05 November 2019 09:47 UTC

Return-Path: <kaduk@mit.edu>
X-Original-To: ipsec@ietfa.amsl.com
Delivered-To: ipsec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 48694120863; Tue, 5 Nov 2019 01:47:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 1U0_UIG1_5lc; Tue, 5 Nov 2019 01:47:40 -0800 (PST)
Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (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 2494D120137; Tue, 5 Nov 2019 01:47:39 -0800 (PST)
Received: from kduck.mit.edu ([24.16.140.251]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id xA59lZ4G032560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 5 Nov 2019 04:47:37 -0500
Date: Tue, 05 Nov 2019 01:47:34 -0800
From: Benjamin Kaduk <kaduk@mit.edu>
To: Paul Wouters <paul@nohats.ca>
Cc: draft-ietf-ipsecme-qr-ikev2.all@ietf.org, ipsec@ietf.org
Message-ID: <20191105094734.GB61969@kduck.mit.edu>
References: <20191105023831.GH55993@kduck.mit.edu> <alpine.LRH.2.21.1911042155390.10876@bofh.nohats.ca>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <alpine.LRH.2.21.1911042155390.10876@bofh.nohats.ca>
User-Agent: Mutt/1.12.1 (2019-06-15)
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/qpewxJGC-e5y153Hx6vWIHw0A6w>
Subject: Re: [IPsec] AD review of draft-ietf-ipsecme-qr-ikev2-08
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipsec/>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Nov 2019 09:47:43 -0000

On Mon, Nov 04, 2019 at 10:39:46PM -0500, Paul Wouters wrote:
> On Mon, 4 Nov 2019, Benjamin Kaduk wrote:
> 
> [ignoring the nits and leaving that to the authors, although reading it
> again I would like to see "he" and "she" replaced by "it" everwhere]

Thanks for chiming in (and quickly)!  I think the "he"/"she" thing has come
up recently in another context, and was left to author discretion, but
perhaps there is a broader conversation to have.

> >   It is an open question whether or not it is feasible to build a
> >   Quantum Computer (and if so, when one might be implemented), but if
> >
> > Feasibility of some quantum computer is becoming much less of an open
> > question; perhaps we want some qualifiers about efficiency, scale,
> > and/or general-purpose-nature.
> 
> It all depends on the algorithms these machines support as well as their
> key size. It's hard to read the the quantum marketing to know what to
> believe :)

Indeed :)

> >   would be compromised.  IKEv1 [RFC2409], when used with strong
> >   preshared keys, is not vulnerable to quantum attacks, because those
> >   keys are one of the inputs to the key derivation function.  If the
> >   preshared key has sufficient entropy and the PRF, encryption and
> >   authentication transforms are postquantum secure, then the resulting
> >   system is believed to be quantum resistant, that is, invulnerable to
> >   an attacker with a Quantum Computer.
> >
> > Do we have a reference for this "it is believed", or is it just the
> > outcome of the WG discussions?
> 
> These are one-way functions with unknown input. There is no way to
> reverse that using any known quantum algorithm.
> 
> >   The general idea is that we add an additional secret that is shared
> >   between the initiator and the responder; this secret is in addition
> >   to the authentication method that is already provided within IKEv2.
> >   We stir this secret into the SK_d value, which is used to generate
> >   the key material (KEYMAT) and the SKEYSEED for the child SAs; this
> >   secret provides quantum resistance to the IPsec SAs (and any child
> >   IKE SAs).  We also stir the secret into the SK_pi, SK_pr values; this
> >   allows both sides to detect a secret mismatch cleanly.
> >
> > With apologies for the pedanticism, let's be careful what wording we
> > use, as just mixing into SK_d is not necessarily enough to get quantum
> > resitsance for the parent IPsec SA.
> > [need to check this some more]
> 
> It is not, but none of the above thanks about the Parent SA. It only
> talks about the Child SA (AKA IPsec SA)

Whoops, the square brackets were notes to myself that escaped prematurely
(I had a long interruption mid-review of this one, which presumably made me
forget they were there.)

I think I'm just complaining about "this secret provides quantum resistance
to the IPsec SAs".  Perhaps I'm not parting the terminology properly, but I
thought that meant (or included?) the parent SA.

> > Every directorate reviewer and IESG member is going to suggest that we
> > use the RFC 8174 version of the boilerplate, if we don't preemptively do
> > so :)
> 
> To be fair, I had to check the publication date of 8174 to see which was
> older - the RFC of the latest version of this draft waiting for the AD :)

I think the line "it's funny because it's true" comes to mind.  I am trying
to do better.

> >   This PPK is independent of the preshared key (if any) that the IKEv2
> >
> > I expect us to get a few questions about why we need a separate PPK in
> > cases when an authentication psk is also available; a short note here
> > might forestall such questions.  (It's needed because PSK for auth does
> > not feed into any of the other key derivations, right?)
> 
> Correct, the PSK is only used in the AUTH payload calculation. In IKEv1, it
> was also mixed into the SKEYSEED, and so a mismatched PSK lead to a
> garbled unreadable IKE packet which was not nice for administrators to
> debug. In IKEv2 this was changed so we can provide proper error messages
> on a wrong PSK. But we did lose the post-quantum protection.
> 
> >   N(USE_PPK) is a status notification payload with the type 16435; it
> >   has a protocol ID of 0, no SPI and no notification data associated
> >   with it.
> >
> > [check the IANA status of the value]
> 
> Those values have been used already for interoperability tests between
> libreswan, strongswan, elvis+, cisco and apple :)

Cool!  I had just left a note to myself to check that the specific value is
in fact allocated, so we don't write a document that "squats" on a
codepoint.  I even did the check before I sent the review; I just failed to
remove this note to myself!

> >   responder included the USE_PPK notification.  If the responder did
> >   not and the flag mandatory_or_not indicates that using PPKs is
> >   mandatory for communication with this responder, then the initiator
> >   MUST abort the exchange.  This situation may happen in case of
> >
> > We might get some directorate questions about what it means to "abort
> > the exchange"; I note that RFC 7296 does not use that terminology,
> > though I'm perfectly happy to leave this as-is and see if we get any ADs
> > that are concerned about it.
> 
> It could be rephased as "abort the exchange by sending an AUTHENTICATION_FAILED
> error notify message back to the initiator".
> 
> >   If the responder did not include the USE_PPK notification and using a
> >   PPK for this particular responder is optional, then the initiator
> >   continues with the IKEv2 protocol as normal, without using PPKs.
> >
> > Do we want to say anything about logging or notifications for this case,
> > in case someone is concerned about the level of quantum-resistance in
> > use?
> 
> That could be done. I just checked our implementation, and we seem to
> not be tracking informational notifies, only error notifies (as can be
> seen here: https://vpn.nohats.ca/munin/vpn-month.html on a test server)
> and indeed we should add it to our implementation. And having a line of
> text here would have cause implementors to do so :)
> 
> >   If the responder did include the USE_PPK notification, then the
> >   initiator selects a PPK, along with its identifier PPK_ID.  Then, she
> >   computes this modification of the standard IKEv2 key derivation:
> >
> > Just to double-check: the responder's USE_PPK is just a boolean "I'm
> > willing to do PPK", right?  So we don't really hae a signal as to which
> > PPK_IDs the peer thinks are valid?
> 
> Right. You would not want to tell an unauthenticated peer which IDs are
> valid. In the case of a remote access VPN, you would have too many valid
> IDs to share. Also in case of using ephemeral or pseudo-random IDs, you
> couldn't have a complete list of these.
> 
> >   That is, we use the standard IKEv2 key derivation process except that
> >   the three subkeys SK_d, SK_pi, SK_pr are run through the prf+ again,
> >   this time using the PPK as the key.  Using prf+ construction ensures
> >
> > Do we want to say anything about why only these three values need the
> > PPK mixed in to them?  (I guess the idea is that the parent SA is
> > "short-lived" on the timescale of a quantum computer and the messages
> > protected directly by it are not of interest to an attacker years in the
> > future.  This does mean that this scheme does not provide much value
> > when a quantum computer is available at the time of the exchange,
> > though, right?
> 
> Practically all information that is in the parent can be learned by an
> active attacker that has no valid credentials, that MITMs a connection.
> The exception to this are the traffic selectors of the IPsec SA.
> 
> Additionally, if you care about this, you can first establish a
> childless Parent SA, then do a Parent SA rekey that uses the PPK, and
> only when you are quantum-safe, do a create_child_sa for the IPsec SA.
> That way, no traffic selectors are available even if the initial Parent
> SA is compromised by a quantum computer. Similarly, if you believe a
> quantum computer would be fast enough to do real time attacks on the
> Parent SA, this trick prevents someone with such a quantum computer from
> sending valid IKE packets. Although even there, the damage that can be
> done is very limited - send a keepalive probe, a delete request, or a
> rekey or create request. Note that a compromised Parent SA does _not_
> lead to compromised Child SA (IPsec SA) because the PPK is not known
> to the attacker even after cracking the Parent SA encryption.

Thanks for the extra discussion (which confirms my understanding of
things).  It is sounding like more text is not really going to be needed
here, then.

> 
> >   The responder then continues with the IKE_AUTH exchange (validating
> >   the AUTH payload that the initiator included) as usual and sends back
> >   a response, which includes the PPK_IDENTITY notification with no data
> >   to indicate that the PPK is used in the exchange:
> >
> > Why does the responder not need to transmit an explicit PPK_ID?  (I see
> > that the following paragraph says that the initiatore MUST ignore any
> > content to that notification, but why?)
> 
> The identity of the responder is always known to the initiator. It is
> the responder they set out to reach. They already know which PPK to
> use with that. The responder however, might not know which of the many
> valid initiators out there is trying to reach them, so they need to be
> told.

Sure ... I'm mostly coming at this from the perspective of the generic
class of (identity) misbinding, that leads us to have each party sign the
other's nonce, etc..  I don't have a concrete attack in this case (and one
seems like it would probably require a misbehaving peer?), so it was just a
question on general principles.

> >      Initiator                         Responder
> >      ----------------------------------------------------------------
> >      HDR, SK {IDi, [CERTREQ,]
> >          [IDr,] SAi2,
> >          TSi, TSr}  -->
> >                                   <--  HDR, SK {IDr, [CERT,] AUTH,
> >                                            EAP}
> >      HDR, SK {EAP}  -->
> >                                   <--  HDR, SK {EAP (success)}
> >      HDR, SK {AUTH,
> >          N(PPK_IDENTITY, PPK_ID)
> >          [, N(NO_PPK_AUTH)]}  -->
> >                                   <--  HDR, SK {AUTH, SAr2, TSi, TSr
> >                                        [, N(PPK_IDENTITY)]}
> >
> > Am I missing something subtle as to why N(PPK_IDENTIFY) is listed as
> > optional here in the EAP case but not in the previous diagram for the
> > non-EAP case?
> 
> You found a real bug :)

(Which version is correct?)

> >
> >   NO_PPK_AUTH notification.  If both the responder and initiator have
> >   been upgraded and properly configured, they will both realize it, and
> >   in that case, the link will be quantum secure.
> >
> > I think that "the link will be quantum secure" is probably overselling
> > things a little bit; for one, the confidentiality protection we provide
> > is only for the child SAs, and the discussion earlier in the document is
> > about providing protection for current connections against future
> > development of a quantum computer, while most people probably think of
> > full "quantum secure" as being protection even against a current quantum
> > computer.
> 
> Instead of the "link", it should probably talk about the IPsec SA being
> quantum secure. A disclaimer like "based on current academic knowledge"
> could be added :P

I won't insist on the extra disclaimer :)

> >      value.  Not all implementations are able to configure arbitrary
> >      octet strings; to improve the potential interoperability, it is
> >      recommended that, in the PPK_ID_FIXED case, both the PPK and the
> >      PPK_ID strings be limited to the base64 character set, namely the
> >      64 characters 0-9, A-Z, a-z, + and /.
> >
> > I don't have much experience with the conventions in this space; does it
> > make sense to distinguish between the PPK representation as configured
> > (which would use the base64 alphabet) and the "actual PPK" that could be
> > binary after, e.g., a base64-decoding step?  I guess it could be
> > reasonable to rely on the ability of the PRF to take an arbitrary-length
> > input and just have sufficient entropy even while limiting the PPK value
> > to the base64 alphabet.
> 
> Based on operational experience, anything not following the above will
> run into interoperability problems. Often people cannot even input a hex
> PSK, so we felt it better to just avoid the PSK issues we know about
> with the new PPK. Similarly, ID_KEY_ID is an ID type that is mostly
> useless in IKE because it is configured differently on each
> implementation.
> 
> >   The PPK_ID type value 0 is reserved; values 3-127 are reserved for
> >   IANA; values 128-255 are for private use among mutually consenting
> >   parties.
> >
> > I guess that anything done in the 128-255 range could also be done under
> > the PPK_ID_OPAQUE space (at the cost of an extra octet), but I don't
> > object to this breakdown.
> 
> Yes. It was mostly done because implementers like something easy to
> compare, and do not like "sub-typing" :)
> 
> > Section 5.2.1
> >
> > I'm kind of confused by the PSKC reference, especially the implication
> > ("algorithm ("Algorithm=urn:ietf:params:xml:ns:keyprov:pskc:pin") as the
> > PIN") that a fixed string is to be used as a PIN.  (I also think it's
> > better to discuss what it does as "key transport" than "key exchange",
> > noting that the latter string does not appear in RFC 6030.)
> 
> I'm pretty confused about that too actually.
> 
> > Section 6
> >
> > We should document the privacy considerations of the PPK_ID both in the
> > face of an attacker with a quantum computer (now or in the future) and
> > in the face of a classical attacker.  The latter would, IIUC, need to be
> > an active MITM in order to see anything other than N(USE_PPK), and who
> > would also get IDi along with the PPK_ID value, so there's not much of a
> > change in the privacy stance.
> 
> I don't think the attack differs whether you have a quantum computer or
> not. Just by relaying as MITM, you can learn IDs. It is inevitable.
> 
> >
> >   [RFC8019] for more detail).  It is RECOMMENDED that implementations
> >   in this situation cache the negative result of negotiation for some
> >   time and don't make attempts to create it again for some time,
> >   because this is a result of misconfiguration and probably some re-
> >   configuration of the peers is needed.
> >
> > Is this "implementations" as initiators, responders, or both?
> 
> Initiators. In IKEv2, responders always only respond once per
> received initiator packet.
> 
> >   removing USE_PPK notification from the IKE_SA_INIT and forging
> >   digital signatures in the subsequent exchange.  If using PPKs is
> >   mandatory for at least one of the peers or PSK is used for
> >   authentication, then the attack will be detected and the SA won't be
> >   created.
> >
> > side note(?): Up in Section 5.2.3 we talk about PPK-only authentication,
> > but here we talk about PSK authentication.  I believe those are distinct
> > things (and thus that there's nothing to change in the text), but am
> > checking just to be sure.
> 
> Yes there are distinct things.
> 
> >   If the attacker manages to inject this packet before the responder
> >   sends a genuine response, then the initiator would abort the
> >   exchange.  To thwart this kind of attack it is RECOMMENDED, that if
> >   using PPKs is mandatory for the initiator and the received response
> >   doesn't contain the USE_PPK notification, then the initiator doesn't
> >   abort the exchange immediately, but instead waits some time for more
> >   responses (possibly retransmitting the request).  If all the received
> >
> > I expect that some reviewer is going to note that this recommendation
> > only occurs in the security considerations section and suggest moving it
> > to the body of the document, and also that we will be asked to give more
> > concrete guidance about "some time".  I don't think either change is
> > critical to make, but consider yourself forewarned...
> 
> Sounds fair. Timing advise would be similar to how long the implemention
> keeps half-open SA's around in general.
> 
> > Section 7
> >
> > We should have a registration template for what information new
> > registration requests should include.  (In particular, since we allow
> > changing entries, a "change controller" and contact information will be
> > needed.)  I suggest including a column for "reference to specification
> > (if available)", even though the "Expert Review" policy does not
> > strictly require one.  We could also provide some guidance to the DEs as
> > to what criteria they may or may not want to apply in deciding whether
> > to approve or reject a registration request.
> 
> Sounds fair.

Thanks again,

Ben