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

Benjamin Kaduk <kaduk@mit.edu> Tue, 05 November 2019 19:59 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 00E32120AF9; Tue, 5 Nov 2019 11:59:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 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] 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 60x1GqXVDhbw; Tue, 5 Nov 2019 11:59:47 -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 3CE0B120B07; Tue, 5 Nov 2019 11:59:47 -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 xA5Jxd7S019128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 5 Nov 2019 14:59:42 -0500
Date: Tue, 05 Nov 2019 11:59:39 -0800
From: Benjamin Kaduk <kaduk@mit.edu>
To: Valery Smyslov <svan@elvis.ru>
Cc: draft-ietf-ipsecme-qr-ikev2.all@ietf.org, ipsec@ietf.org
Message-ID: <20191105195939.GH61969@kduck.mit.edu>
References: <20191105023831.GH55993@kduck.mit.edu> <058d01d593e5$0be7eb80$23b7c280$@elvis.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <058d01d593e5$0be7eb80$23b7c280$@elvis.ru>
User-Agent: Mutt/1.12.1 (2019-06-15)
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/yTIbMTsqm_dc4xaK2JxB_kO9l6c>
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 19:59:57 -0000

On Tue, Nov 05, 2019 at 05:26:43PM +0300, Valery Smyslov wrote:
> Hi Ben,
> 
> many thanks for the very thorough review. Please, see inline.
> 
> > Hi all,
> > 
> > Thanks for this document -- it's pretty readable (once I did my background
> > reading on RFC 7296) and is an interim measure that we're seeing some
> > demand for already.  Sorry to have been sitting on this for so long; my
> > backlog is taking longer to clear than planned.
> > 
> > There are a few substantitve comments mixed in with the nits -- the IANA
> > Considerations in particular will probably need a bit more attention to get
> > fleshed out with what we need.
> > 
> > Anyway, here are the section-by-section notes.
> 
> In an attempt to make the message more readable I removed all the nits
> that are silently accepted (thanks for catching them).

Thanks for that; I don't have a great workflow to split them out into a
separate section/document yet.

> > Section 1
> > 
> >    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.
> 
> Do you have any data or pointers?

I'm mostly just thinking about press releases from D-WAVE and Google that
get turned into articles in the technology press.  We see headlines about
60+ q-bit machines, that more likely than not are doing *something*.  So in
my mind it becomes a question of whether what these machines (that exist and
are being sold) are doing is useful for the problems relevant to a given
technology, rather than whether a quantum computer exists.  (I'm not even
sure that there's a generally accepted definition for what "quantum
computer" means -- some people seem to use it for just annealing-based
stuff.)

> >    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?
> 
> I'll let my co-authors comment on this, but I think it is meant
> that according to our best current knowledge nothing 
> better than Grover's algorithm can be used to break symmetric 
> key cryptosystem with QC. And Grover's algorithm only
> halves an effective key length, so if longer PSK is used, we're safe
> (we believe we are).

To be clear: I share this belief! :)
I am just asking if it is sufficiently well-known/widespread that no
reference is needed; that may well be the case.

> >    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]
> 
> Well, there is no "parent IPsec SA" in IKEv2, all the IPsec SAs
> are children of an IKE SA. They are created using SK_d as a key,
> so if PPK is mixed into SK_d, then all Child IIPsec) SAs are protected.
> Moreover, the SK_d is used when IKE SA is rekeyed as one of the inputs
> for computation of new keys, so once IKE SA is rekeyed, the new
> IKE SA will be QC-resistant too.

Oh, this is probably the key part of my confusion/misunderstanding with the
terminology (which also shows up later on, IIRC).
Namely, that the initial exchange generates an IKE SA, and the other SAs
("children" for ESP/AH usage) are called IPsec SAs (not IKE SAs).
In that case this text is fine as-is and there's nothing to change, so
sorry for the noise.

> > Section 1.2
> > 
> > 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 :)
> 
> Haven't we added it yet? Oh, my bad, the draft is so old, that
> it doesn't even reference 8174 :-) Fixed.
> 
> > Section 2
> > 
> >    We assume that each IKE peer has a list of Postquantum Preshared Keys
> >    (PPK) along with their identifiers (PPK_ID), and any potential IKE
> >    initiator has a selection of which PPK to use with any specific
> >    responder.  In addition, implementations have a configurable flag
> > 
> > nit: I'm not sure what "has a selection of" is intended to mean.  Is it
> > more about making a choice of which PPK to use or about having a list to
> > choose from?
> 
> The former - making a choice of which PPK to use with any
> specific responder. Do you think it should be rephrased?

I'd suggest "any potential IKE initiator selects which PPK to use with any
specific responder".  (The other case involves the word "selection" in the
sense of "this restaurant has a large selection of wines", but we want the
verb form of "selection".)

> >    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?)
> 
> Exactly. I've added short explanation:
> 
>       This PPK is independent of the preshared key (if any) that the IKEv2 protocol uses to perform authentication
>       (because preshared key in IKEv2 is not used for any key derivation, and thus doesn't protect against Quantum Computers).
> 
> Is it OK?

That's the right level of detail/length, thanks.
(nit: "the preshared key")

> >    protocol uses to perform authentication.  The PPK specific
> >    configuration that is assumed on each peer consists of the following
> >    tuple:
> > 
> >    Peer, PPK, PPK_ID, mandatory_or_not
> > 
> > nit: we use "peer" twice here, and the context suggests that they refer
> > to different parties in the different places.
> 
> If we change it to:
> 
> "The PPK specific configuration that is assumed on each node consists of the following tuple:"
> 
> does it eliminate the possible confusion?

Yes!

> > Section 3
> > 
> >    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]
> 
> These values have been allocated by IANA as a result of early allocation request.
> 
> >    If the responder does not support this specification or does not have
> >    any PPK configured, then she ignores the received notification and
> >    continues with the IKEv2 protocol as normal.  Otherwise the responder
> >    checks if she has a PPK configured, and if she does, then the
> > 
> > nit: we probably don't need to mention "if [...] PPK configured" twice.
> 
> Removed second instance of the phrase.
> 
> >    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.
> 
> In this context "abort the exchange" means that the initiator
> just stops any activity related to this exchange (but 
> see Security Considerations for some hints).
> 
> >    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?
> 
> Hmmm. I think that we follow RFC 7296 tradition that leaves
> all logging (and the like) up to implementations...

If we do that, I'd suggest a little more exposition in the security
considerations about how operational misconfiguration or similar could
result in PPKs not being used, unless the "PPK is mandatory" knob is
switched on.

> >    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?
> 
> Yes. The PPK_ID is sent by the initiator in the IKE_AUTH request,
> the IKE_SA_INIT only negotiate using PPK without specifying 
> which PPK to use.
> 
> >    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?
> 
> No, the reason is different. The PPK_ID is sent in the IKE_AUTH,
> that is protected by the SK_ei/er/ai/ar keys. If these keys were
> dependent on PPK, then in case of PPK mismatch the responder
> would not be able to decrypt the message and thus cannot handle
> this situation properly. We ran into this problem with IKEv1,
> when PSK was stirred into key computation and in case of PSK mismatch
> the responder received garbage, and wasn't able to recover gracefully.
> 
> For this reason it was decided by the WG to only mix PPK into SK_d
> and SK_pi/pr, leaving it out from SK_ei/er/ai/ar. This leaves
> initial IKE SA not protected against QC, but allows the protocol to 
> handle PPK mismatch gracefully.

Ah, okay.  (I think this is discussed adequately later on in the document,
so don't feel obligated to add any new text here if you don't want to.)

> >    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?)
> 
> Because we use a single PPK for both (unlike PSKs, which can be different
> for initiator and responder). So, the purpose of the PPK_IDENTITY
> in this case is just to confirm that the responder agrees to use the PPK,
> which the initiator selected. There is no need to return it back - 
> the responder cannot change it, so an empty notification
> does the job and saves some space. 
> 
> >    not yet known to the responder.  Once the IKE_AUTH request message
> >    containing PPK_IDENTITY notification is received, the responder
> >    follows rules described above for non-EAP authentication case.
> > 
> > nits: (missing "the"s) "the PPK_IDENTITY notification", "the rules
> > described above", "the non-EAP authentication case"
> 
> Oh, it's my text, I've been always having problems with articles :-)

English is a pretty silly language in this way (and many others) :)

> >       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?
> 
> In the previous diagram we consider only the case when using
> PPK is agreed upon, so N(PPK_IDENTITY) is not optional.
> We leave out the case when using PPK is optional
> for both and the responder doesn't have the PPK the initiator
> has selected, in which case the normal IKE_AUTH takes place
> (which is not depicted and is only spelled out).
> 
> With EAP a single diagram shows all possible scenarios,
> thus  N(PPK_IDENTITY) becomes optional here.

Ah, I see, since in the other case we split up each step of the exchange
into a separate diagram, so they had narrower focus.

> > Section 4
> > 
> >    With this configuration, the node will continue to operate with nodes
> >    that have not yet been upgraded.  This is due to the USE_PPK notify
> >    and the NO_PPK_AUTH notify; if the initiator has not been upgraded,
> >    he will not send the USE_PPK notify (and so the responder will know
> > 
> > nit: I think we should be consistent about using either "notification"
> > or "Notify payload"/"Notify message", avoiding just the bare "notify".
> > (Also occurs in subsequent locations that I won't quote/mention
> > individually.)
> 
> Changed to "notification" in all places.
> 
> >    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.
> 
> Changed to "Child SAs".
> 
> >    As an optional second step, after all nodes have been upgraded, then
> >    the administrator should then go back through the nodes, and mark the
> >    use of PPK as mandatory.  This will not affect the strength against a
> >    passive attacker; it would mean that an attacker with a Quantum
> >    Computer (which is sufficiently fast to be able to break the (EC)DH
> >    in real time) would not be able to perform a downgrade attack.
> > 
> > It seems like (given the current lack of advice for logging/reporting,
> > as noted above) changing the use of PPK to mandatory also serves to
> > provide notification if any future misconfiguration changes regarding
> > the use of PPK, to give a more robust indication of when the desired
> > protection is not being applied.
> 
> Implicitly. However, even if we don't mandate any logging,
> wise implementations would log all the important information
> anyway.
> 
> > Section 5.1
> > 
> >       initiator and the responder.  The responder can use to do a look
> >       up the passed PPK_ID value to determine the corresponding PPK
> >       value.  Not all implementations are able to configure arbitrary
> > 
> > nit: this sentence is hard to follow; I suggest
> > 
> > % The responder can use the PPK_ID to look up the corresponding PPK
> > % value.
> 
> OK.
> 
> >       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.
> 
> I recall it was requested by somebody during discussion in the WG.
> I tend to agree with you, but I'd rather to wait for some input
> from others.
> 
> >    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.
> 
> We think that for some use cases new PPK_ID types may be needed.
> 
> > 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 recall it was requested by somebody during discussion in the WG...

To be clear, unless someone can explain to me how I'm misunderstanding the
current text (and thus that the current text makes sense), I object to the
current description.  It doesn't give me a clear picture of what I'd need
to do to use it, and what it seems to describe sounds insecure based on my
preconceptions of the terminology used.  (I have no prior experience with
PSKC, to be clear.)

> > Section 5.2.2
> > 
> >    It is possible to use a single PPK for a group of users.  Since each
> >    peer uses classical public key cryptography in addition to PPK for
> >    key exchange and authentication, members of the group can neither
> >    impersonate each other nor read other's traffic, unless they use
> >    Quantum Computers to break public key operations.  However group
> >    members can record other members' traffic and decrypt it later, when
> >    they get access to a Quantum Computer.
> > 
> > nit: I suggest "can record any traffic they have access to that comes
> > from other group members and decrypt it later", since just being a group
> > member does not grant one a universal network tap.
> 
> OK.
> 
> > 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.
> 
> OK, we'll think how to do it right.
> 
> >    [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?
> 
> Initiator. Changed to "the initiator".

Thanks!

> >    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.
> 
> Those are distinct things.
> 
> PPK-only authentication is in fact the NULL authentication
> method used with PPK, so if using PPK is optional for both peers, 
> then the described attack works even without QC, the attacker
> just removes all PPK related stuff from the messages.
> 
> Note, that 5.2.3 requires that PPK is mandatory for both peers
> for PPK-only authentication to work.

Yes, I do remember that, and am happy to see that requirement.

> >    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...
> 
> OK, we'll consider :-)
> 
> > 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.
> 
> Adding a reference column makes a lot of sense, thanks.
> 
> > Appendix A
> > 
> >    A fourth goal was to avoid violating any of the security goals of
> >    IKEv2.
> > 
> > nit: It is sometimes considered good style to avoid using the same word
> > too much in close succession (here, "goal"); would it change the meaning
> > to say "the security properties provided by IKEv2"?
> 
> OK, thanks.

Thanks,

Ben