<?xml version="1.0" encoding="US-ASCII"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 SYSTEM "reference.RFC.2119.xml">
<!ENTITY rfc7258 SYSTEM "reference.RFC.7258.xml">
<!ENTITY rfc4301 SYSTEM "reference.RFC.4301.xml">
<!ENTITY rfc5739 SYSTEM "reference.RFC.5739.xml">
<!ENTITY rfc7296 SYSTEM "reference.RFC.7296.xml">
<!ENTITY rfc7435 SYSTEM "reference.RFC.7435.xml">
]>

<rfc number="7619"
     category="std" 
     submissionType="IETF"
     consensus="yes"
     updates="4301" 
     ipr="trust200902"> 
     

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="no"?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

    <front>
        <title abbrev="NULL Auth in IKEv2">
	The NULL Authentication Method in&nbsp;the&nbsp;Internet&nbsp;Key&nbsp;Exchange&nbsp;Protocol&nbsp;Version&nbsp;2&nbsp;(IKEv2)</title>
        <author initials='V.' surname="Smyslov" fullname='Valery Smyslov'>
            <organization>ELVIS-PLUS</organization>
            <address>
                <postal>
                    <street>PO Box 81</street>
                    <city>Moscow (Zelenograd)</city>
                    <code>124460</code>
                    <country>Russian Federation</country>
                </postal>
                <phone>+7 495 276 0211</phone>
                <email>svan@elvis.ru</email>
            </address>
        </author>

        <author initials='P.' surname="Wouters" fullname='Paul Wouters'>
            <organization>Red Hat</organization>
            <address>
                <email>pwouters@redhat.com</email>
            </address>
        </author>

        <date month="August" year="2015"/>

<keyword>unauthenticated</keyword>
<keyword>opportunistic security</keyword>
<keyword>pervasive monitoring</keyword>
<keyword>Peer Authorization Database</keyword>
<keyword>PAD</keyword>

        <abstract>
        <t>This document specifies the NULL Authentication method
        and the ID_NULL Identification Payload ID Type for Internet Key
	    Exchange Protocol version 2 (IKEv2). This allows two IKE peers to establish single-side
        authenticated or mutual unauthenticated IKE sessions for those
        use cases where a peer is unwilling or unable to authenticate or
        identify itself. This ensures IKEv2 can be used for Opportunistic
        Security (also known as Opportunistic Encryption) to defend against
        Pervasive Monitoring attacks without the need to sacrifice anonymity.
        </t>
        </abstract>
    </front>

    <middle>
        <section title="Introduction">
            <t>Internet Key Exchange Protocol version 2 (IKEv2), specified
	        in <xref target="RFC7296"/>, provides a way for two 
            parties to perform an authenticated key exchange. While the
            authentication methods used by the peers can be different, there
            is no method for one or both parties to remain unauthenticated
            and anonymous. This document extends the authentication methods
            to support unauthenticated and anonymous IKE sessions.
            </t>

            <t>In some situations, mutual authentication is undesirable, superfluous, or impossible. The
                following three examples illustrate these unauthenticated use cases:
                <list style="symbols">
                    <t>A user wants to establish an anonymous secure connection to a server.
                    In this situation, the user should be able to authenticate the server
                    without presenting or authenticating to the server with their own identity.
                    This case uses a single-sided authentication of the responder.
                    </t>
                    <t>A sensor that periodically wakes up from a suspended state wants to send
                    a measurement (e.g., temperature) to a collecting server. The sensor must be
                    authenticated by the server to ensure authenticity of the measurement, but the
                    sensor does not need to authenticate the server.
                    This case uses a single-sided authentication of the initiator.
                    </t>
                    <t>Two peers without any trust relationship wish to defend against widespread
                    pervasive monitoring attacks as described in <xref target="RFC7258"/>. Without a
                    trust relationship, the peers cannot authenticate each other. Opportunistic Security
                    <xref target="RFC7435"/> states that unauthenticated encrypted communication is
                    preferred over cleartext communication. The peers want to use IKE to setup 
                    an unauthenticated encrypted connection that gives them protection against 
                    pervasive monitoring attacks. An attacker that is able and willing to send packets
                    can still launch a man-in-the-middle (MITM) attack to
		            obtain a copy of the unencrypted
                    communication. This case uses a fully unauthenticated key exchange.
                    </t>
                </list>
            To meet these needs, this document introduces the NULL Authentication method and the ID_NULL
            ID type. This allows an IKE peer to explicitly indicate that it is unwilling or unable
            to certify its identity.
            </t>

            <section title="Conventions Used in This Document">
                <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
                "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
                document are to be interpreted as described in <xref target="RFC2119"/>.</t>
            </section>
        </section>

        <section title="Using the NULL Authentication Method">
            <t>In IKEv2, each peer independently selects the method to
            authenticate itself to the other side.  A peer may choose to
            refrain from authentication by using the NULL Authentication method. 
            If a host's local policy requires that the identity of its peer be
            (non-null) authenticated, and if that host receives an AUTH
            payload containing the NULL Authentication method type, it MUST
            return an AUTHENTICATION_FAILED notification.
            If an initiator uses the Extensible Authentication Protocol (EAP), 
	        the responder MUST NOT use the NULL
            Authentication method (in conformance with Section 2.16
            of <xref target="RFC7296"/>).
            </t>

            <t>NULL authentication affects how the Authentication and 
            the Identification payloads are formed in the IKE_AUTH exchange.
            </t>

            <section title="Authentication Payload">
                <t>NULL authentication still requires a properly formed AUTH payload to be present in
                the IKE_AUTH exchange messages, as the AUTH payload cryptographically links 
                the IKE_SA_INIT exchange messages with the other messages sent
		        over this IKE Security Association (SA).
                </t>
    
                <t>When using NULL authentication, the content of the AUTH 
                payload is computed using the syntax of pre-shared secret authentication,
                described in Section 2.15 of <xref target="RFC7296"/>.
                The value of SK_pi for the initiator and SK_pr for the responder is
                used as the shared secret for the content of the AUTH payload. Implementers
                should note this means that authentication keys used by the two peers are different in
                each direction. This is identical to how the contents of the two last AUTH payloads
                are generated for the non-key-generating EAP methods
                (see Section 2.16 of <xref target="RFC7296"/> for details).
                </t>

                <t>The IKEv2 Authentication Method value for NULL Authentication is 13.</t>
            </section>
    
            <section title="Identification Payload">
                <t>When a remote peer is not authenticated, any ID presented in the Identification Data 
                field of the ID payload cannot be validated. To avoid the need of sending a bogus 
                ID Type with placeholder data, this specification defines a new ID Type, ID_NULL.
                The Identification Data field of the ID payload for this ID Type MUST be empty.
                </t>

                <t>If NULL authentication is in use and anonymity is a concern, then
                ID_NULL SHOULD be used in the Identification payload.
                Some examples of cases where a non-null identity type and value with NULL authentication 
                can be used are logging, troubleshooting, and in scenarios where
                authentication takes place out of band after the IKE SA is created
                (like in <xref target="AUTOVPN"/>). The content of the Identification payload
                MUST NOT be used for any trust and policy checking
                in IKE_AUTH exchange when NULL authentication is employed
                (see Section 2.4 for details).
                </t>

                <t>ID_NULL is primarily intended to be used with NULL authentication but
                could be used in other situations where the content of the Identification
                payload is not used. For example, ID_NULL could be used when authentication
                is performed via raw public keys and the identities are the keys
                themselves. These alternative uses of ID_NULL should be described in
                their own respective documents.
                </t>

                <t>The IKEv2 Identification Payload ID Type for ID_NULL is 13.</t>
            </section>

            <section title="INITIAL_CONTACT Notification">
                <t>The identity of a peer using NULL authentication cannot be used to
                find existing IKE SAs created by the same peer, as the peer identity is not
                authenticated.  For that reason, the INITIAL_CONTACT notifications
                MUST NOT be used to delete any other IKE SAs based on the same peer
                identity without additional verification that the existing IKE SAs
                with matching identity are actually stale.
                </t>

                <t>The standard IKE Liveness Check procedure, described in Section 2.4 of 
                <xref target="RFC7296"/>, can be used to detect stale
                IKE SAs created by peers using NULL authentication. 
                Inactive, unauthenticated IKE SAs should be checked periodically. 
                Additionally, the event of creating a new unauthenticated
                IKE SA can be used to trigger an out-of-order check on existing unauthenticated IKE SAs
                possibly limited to identical or close-by IP addresses or to identical identities  
                of the just created IKE SA.
                </t>

                <t>Implementations should weigh the resource consumption of sending Liveness
                Checks against the memory usage of possible orphaned IKE SAs.
                Implementations may choose to handle situations with thousands 
                of unauthenticated IKE SAs differently from situations with very few such SAs. 
                </t>
            </section>

            <section anchor="pad" title="Interaction with the Peer Authorization Database (PAD)">
                <t>Section 4.4.3 of <xref target="RFC4301"/> defines the Peer Authorization Database
                (PAD), which provides the link between the Security Policy Database (SPD) and IKEv2.
                The PAD contains an ordered list of records with peers' identities
                along with corresponding authentication data and Child SA authorization data. 
                When the IKE SA is being established, the PAD is consulted to determine how
                the peer should be authenticated and what Child SAs it is authorized to create.
                </t>

                <t>When using NULL authentication, the peer identity is not authenticated and cannot
                be trusted. If ID_NULL is used with NULL authentication, there is no ID at all. The
                processing of the PAD described in Section 4.4.3 of <xref
		        target="RFC4301"/> is updated 
                for NULL authentication as follows.
                </t>

                <t>NULL authentication is added as one of the supported authentication 
                methods. This method does not have any authentication data.
                ID_NULL is included into the list of allowed ID types. 
                The matching rule for ID_NULL consists only of whether 
                this type is used, i.e., no actual ID matching is done 
                as ID_NULL contains no identity data.
                </t>

                <t>When using the NULL Authentication method, those matching rules MUST
                include matching of a new flag in the SPD entry specifying whether
                unauthenticated users are allowed to use that entry. That is, each
                SPD entry needs to be augmented to have a flag specifying whether it
                can be used with NULL authentication or not, and only those rules
                that explicitly have that flag turned on can be used with
                unauthenticated connections.
                </t>

                <t>The specific updates of text in Section 4.4.3 of <xref target="RFC4301"/>
                are listed in <xref target="update4301"/>.
                </t>
            </section>

            <section title="Traffic Selectors">
                <t>Traffic Selectors and narrowing allow two IKE peers
                to mutually agree on a traffic range for an IPsec SA. An
                unauthenticated peer must not be allowed to use this
                mechanism to steal traffic that an IKE peer intended to
                be for another host. This is especially problematic when
                supporting anonymous IKE peers behind NAT, as such IKE
                peers build an IPsec SA using their pre-NAT IP address that
                is different from the source IP of their IKE packets. 
                A rogue IKE peer could use malicious Traffic Selectors to trick
                a remote host into giving it IP traffic that the remote host never
                intended to be sent to remote IKE peers. For example, if the remote
                host uses 192.0.2.1 as the DNS server, a rogue IKE peer could set its
                Traffic Selector to 192.0.2.1 in an attempt to receive the remote
                peer's DNS traffic. Implementations SHOULD restrict and isolate all
                anonymous IKE peers from each other and itself and only
                allow it access to itself and possibly its intended network
                ranges.
                </t>

                <t>One method to achieve this is to always 
                assign internal IP addresses to unauthenticated IKE clients,
                as described in Section 2.19 of <xref target="RFC7296"/>. 
                Implementations may also use other techniques such as internal NAT and connection tracking.
                </t>

                <t>Implementations MAY force unauthenticated IKE peers
                to single host-to-host IPsec SAs. When using IPv6,
                this is not always possible, so implementations 
                MUST be able to assign a full /64 address block
                to the peer as described in <xref target="RFC5739"/>,
                even if it is not authenticated.
                </t>
            </section>
        </section>

        <section title="Security Considerations">
            <t>If authenticated IKE sessions are possible for a certain Traffic Selector
            range between the peers, then unauthenticated IKE SHOULD NOT be allowed for that
            Traffic Selector range. When mixing authenticated and unauthenticated IKE with
            the same peer, policy rules should ensure the highest level of security will
            be used to protect the communication between the two peers.
            See <xref target="RFC7435"/> for details.
            </t>

            <t>If both peers use NULL authentication, the
            entire key exchange becomes unauthenticated. This makes
            the IKE session vulnerable to active MITM
            attacks. 
            </t>

            <t>Using an ID Type other than ID_NULL with the NULL Authentication
            method may compromise the client's anonymity in case of an active
            MITM attack.
            </t>

            <t>IKE implementations without NULL authentication
            have always performed mutual authentication and
            were not designed for use with unauthenticated IKE peers.
            Implementations might have made assumptions that remote peers 
            are identified. With NULL authentication, these assumptions 
            are no longer valid. Furthermore, the host itself might have
            made trust assumptions or may not be aware of the network
            topology changes that resulted from IPsec SAs from
            unauthenticated IKE peers.
            </t>

            <section title="Audit Trail and Peer Identification">
                <t>With NULL authentication, an established IKE session is no longer
                guaranteed to provide a verifiable (authenticated) entity known to
                the system or network. Any logging of unproven ID payloads that
                were not authenticated should be clearly marked and treated as
                "untrusted" and possibly accompanied by logging the remote IP address
                of the IKE session. Rate limiting of logging might be required to
                prevent excessive resource consumption causing system damage.
                </t>
            </section>
    
            <section title="Resource Management and Robustness">
                <t>Section 2.6 of <xref target="RFC7296"/> provides guidance
                for mitigation of denial-of-service (DoS) attacks by issuing
                COOKIES in response to resource consumption of half-open IKE
                SAs. Furthermore, <xref target="DDOS-PROTECTION"/> offers
                additional countermeasures in an attempt to distinguish
                attacking IKE packets from legitimate IKE peers.
                </t>
    
                <t>These defense mechanisms do not take into account IKE
                systems that allow unauthenticated IKE peers. An attacker
                using NULL authentication is a fully legitimate
                IKE peer that is only distinguished from authenticated IKE
                peers by having used NULL authentication.
                </t>
    
                <t>Implementers that implement NULL authentication should 
                ensure their implementation does not make any assumptions 
                that depend on IKE peers being "friendly", "trusted", or "identifiable".
                While implementations should have been written to
                account for abusive authenticated clients, any omission or
                error in handling abusive clients may have gone unnoticed
                because abusive clients have been a rare or nonexistent
                problem. When adding support for unauthenticated IKE peers, these
                implementation omissions and errors will be found and abused
                by attackers. For example, an unauthenticated IKE peer could
                send an abusive amount of Liveness probes or Delete requests.
                </t>
            </section>
    
            <section title="IKE Configuration Selection">
                <t>Combining authenticated and unauthenticated IKE peers on
                a single host can be dangerous, assuming the authenticated IKE
                peer gains more or different access from unauthenticated peers
                (otherwise, why not only allow unauthenticated peers). An
                unauthenticated IKE peer MUST NOT be able to reach resources only
                meant for authenticated IKE peers and MUST NOT be able to replace the
                Child SAs of an authenticated IKE peer.
                </t>
            </section>
    
            <section title="Networking Topology Changes">
                <t>When a host relies on packet filters or firewall software
                to protect itself, establishing an IKE SA and installing an
                IPsec SA might accidentally circumvent these packet filters
                and firewall restrictions, as the 
		        Encapsulating Security Payload (ESP, protocol 50)
                or ESPinUDP (UDP port 4500) packets of the encrypted traffic
                do not match the packet filters defined for unencrypted traffic. 
                IKE peers supporting unauthenticated IKE
                MUST pass all decrypted traffic through the same packet
                filters and security mechanisms as incoming plaintext traffic.
                </t>
            </section>
        </section>

        <section title="IANA Considerations">
            <t>Per this document, IANA has added a new entry in the "IKEv2 Authentication Method" registry:</t>
            <figure align="center">
                <artwork align="left"><![CDATA[
  13       NULL Authentication
                                          ]]></artwork>
            </figure>
            <t>Per this document, IANA has added a new entry in the "IKEv2 Identification Payload ID Types" 
            registry:</t>
            <figure align="center">
                <artwork align="left"><![CDATA[
  13       ID_NULL
                                          ]]></artwork>
            </figure>
        </section>
    </middle>

    <back>
        <references title='Normative References'>
            &rfc2119;
            &rfc4301;
            &rfc5739;
            &rfc7296;
        </references>

        <references title='Informative References'>
            &rfc7258;
            &rfc7435;

<!-- draft-sheffer-autovpn-00: I-D Expired -->
            <reference anchor='AUTOVPN'>
              <front>
                <title>The AutoVPN Architecture</title>
                <author initials='Y' surname='Sheffer' fullname='Yaron Sheffer'>
                  <organization />
                </author>
                <author initials='Y' surname='Nir' fullname='Yoav Nir'>
                  <organization />
                </author>
                <date month='February' year='2014' />
              </front>
              <seriesInfo name='Work in Progress,' value='draft-sheffer-autovpn-00' />
            </reference>

<reference anchor='DDOS-PROTECTION'>
<front>
<title>Protecting Internet Key Exchange (IKE) Implementations from Distributed Denial of Service Attacks</title>
<author initials='Y' surname='Nir' fullname='Yoav Nir'>
    <organization />
</author>
<author initials='V' surname='Smyslov' fullname='Valery Smyslov'>
    <organization />
</author>
<date month='July' year='2015' />
</front>
<seriesInfo name='Work in Progress,' value='draft-ietf-ipsecme-ddos-protection-02' />
</reference>
        </references>

        <section title="Update of PAD processing in RFC 4301" anchor="update4301">
            <t>This appendix lists the specific updates of the text in Section 4.4.3 of 
            <xref target="RFC4301"/> that should be followed when implementing NULL authentication.</t>

            <t>A new item is added to the list of supported ID types in
	    Section 4.4.3.1 of <xref target="RFC4301"/>
            <list style="symbols">
                <t>NULL ID (matches ID type only)</t>
            </list>
            and the following text is added at the end of the section:
            <list style="hanging" hangIndent="3">
                <t hangText="Added text: "><vspace/>The NULL ID type is defined as having no data. For this name type,
                the matching function is defined as comparing the ID type only.</t>
            </list>
            </t>

            <t>A new item is added to the list of authentication data types in
	    Section 4.4.3.2 of <xref target="RFC4301"/>:
            <list>
                <t>- NULL authentication</t>
            </list>
            and the next paragraph is updated as follows:
            <list style="hanging" hangIndent="3">
                <t hangText="Old: "><vspace/>For authentication based on an X.509 certificate [...]
                For authentication based on a pre-shared
                secret, the PAD contains the pre-shared secret to be used by IKE.</t>
                <t hangText="New: "><vspace/>For authentication based on an X.509 certificate [...]
                For authentication based on a pre-shared
                secret, the PAD contains the pre-shared secret to be used by IKE.
                For NULL authentication the PAD contains no data.</t>
            </list></t>
            

            <t>In addition, the following text is added at the end of Section
	    4.4.3.4 of <xref target="RFC4301"/>:
            <list style="hanging" hangIndent="3">
                <t hangText="Added text: "><vspace/>When using the NULL Authentication method, 
                implementations MUST make sure that they do not mix authenticated and 
                unauthenticated SPD rules, i.e., implementations need to keep them separately; 
                for example, by adding a flag in the SPD to tell whether NULL authentication can 
                be used or not for the entry. That is, each SPD entry needs to be augmented 
                to have a flag specifying whether it can be used with NULL authentication 
                or not, and only those rules that explicitly have that flag set
                can be used with unauthenticated connections.
                </t>
            </list>
            </t>
        </section>
        <section title="Acknowledgments" numbered="no">
            <t>The authors would like to thank Yaron Sheffer and Tero Kivinen
            for their reviews, valuable comments, and contributed text.</t></section>
    </back>
</rfc>
