Re: [IPsec] [Last-Call] Secdir last call review of draft-ietf-ipsecme-rfc8229bis-06

Christian Huitema <huitema@huitema.net> Mon, 30 May 2022 15:01 UTC

Return-Path: <huitema@huitema.net>
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 337C9C1A7F1E for <ipsec@ietfa.amsl.com>; Mon, 30 May 2022 08:01:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.784
X-Spam-Level:
X-Spam-Status: No, score=-3.784 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, NICE_REPLY_A=-1.876, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SWHwJ9za9LmL for <ipsec@ietfa.amsl.com>; Mon, 30 May 2022 08:01:27 -0700 (PDT)
Received: from mx36-out10.antispamcloud.com (mx36-out10.antispamcloud.com [209.126.121.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5DEC6C1A7F00 for <ipsec@ietf.org>; Mon, 30 May 2022 08:01:27 -0700 (PDT)
Received: from xse412.mail2web.com ([66.113.197.158] helo=xse.mail2web.com) by mx256.antispamcloud.com with esmtp (Exim 4.92) (envelope-from <huitema@huitema.net>) id 1nvgtU-000HBb-SW for ipsec@ietf.org; Mon, 30 May 2022 17:01:25 +0200
Received: from xsmtp22.mail2web.com (unknown [10.100.68.61]) by xse.mail2web.com (Postfix) with ESMTPS id 4LBdrW1FWXzBXt for <ipsec@ietf.org>; Mon, 30 May 2022 08:00:43 -0700 (PDT)
Received: from [10.5.2.16] (helo=xmail06.myhosting.com) by xsmtp22.mail2web.com with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from <huitema@huitema.net>) id 1nvgst-0008Gh-10 for ipsec@ietf.org; Mon, 30 May 2022 08:00:43 -0700
Received: (qmail 4967 invoked from network); 30 May 2022 15:00:40 -0000
Received: from unknown (HELO [192.168.1.106]) (Authenticated-user:_huitema@huitema.net@[172.58.43.86]) (envelope-sender <huitema@huitema.net>) by xmail06.myhosting.com (qmail-ldap-1.03) with ESMTPA for <svan@elvis.ru>; 30 May 2022 15:00:39 -0000
Message-ID: <9d37d517-b6ff-6965-40a2-67f5c2a3e476@huitema.net>
Date: Mon, 30 May 2022 08:00:36 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1
Content-Language: en-US
To: Valery Smyslov <svan@elvis.ru>, secdir@ietf.org
Cc: draft-ietf-ipsecme-rfc8229bis.all@ietf.org, ipsec@ietf.org, last-call@ietf.org
References: <165377251630.6282.16767658545384357479@ietfa.amsl.com> <077301d8741b$c0fe9b40$42fbd1c0$@elvis.ru>
From: Christian Huitema <huitema@huitema.net>
In-Reply-To: <077301d8741b$c0fe9b40$42fbd1c0$@elvis.ru>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Originating-IP: 66.113.197.158
X-Spampanel-Domain: xsmtpout.mail2web.com
X-Spampanel-Username: 66.113.197.0/24
Authentication-Results: antispamcloud.com; auth=pass smtp.auth=66.113.197.0/24@xsmtpout.mail2web.com
X-Spampanel-Outgoing-Class: unsure
X-Spampanel-Outgoing-Evidence: Combined (0.15)
X-Recommended-Action: accept
X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT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am@quarantine11.antispamcloud.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/VLnyAX0TD2JEQ-3KK502ccR7uIo>
Subject: Re: [IPsec] [Last-Call] Secdir last call review of draft-ietf-ipsecme-rfc8229bis-06
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.34
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: Mon, 30 May 2022 15:01:28 -0000

On 5/30/2022 4:52 AM, Valery Smyslov wrote:
> Hi Christian,
>
> thank you for your review! Please, find my comments inline.
>
>> -----Original Message-----
>> From: Christian Huitema via Datatracker [mailto:noreply@ietf.org]
>> Sent: Sunday, May 29, 2022 12:15 AM
>> To: secdir@ietf.org
>> Cc: draft-ietf-ipsecme-rfc8229bis.all@ietf.org; ipsec@ietf.org; last-call@ietf.org
>> Subject: Secdir last call review of draft-ietf-ipsecme-rfc8229bis-06
>>
>> Reviewer: Christian Huitema
>> Review result: Has Nits
>>
>> I have reviewed this document as part of the security directorate's ongoing
>> effort to review all IETF documents being processed by the IESG.  These
>> comments were written primarily for the benefit of the security area directors.
>> Document editors and WG chairs should treat these comments just like any other
>> last-call comments.
>>
>> This draft is ready, with a single nit: I wish the security section mentioned
>> data injection attacks over TCP, not just SYN flooding and RST attacks.
>>
>> This draft is a bis version of RFC 8229, which describes how to encapsulate IKE
>> and IPSEC in TCP. The new text adds precisions on how to handle TCP specific
>> issues, which taken together help making the the specification more robust. The
>> changes from RFC 8229 include:
>>
>> * added section 7.2, retransmission, specify that UDP-style retransmission
>> logic of IKE should be replaced by simple detection of failure over timers, and
>> that if an initiator wants to retry an exchange, they have to start a new
>> connection.
>>
>> * added section 7.3, cookies and puzzles, points out that source address
>> spoofing is already prevented by the 3-ways handshake of TCP, and that cookies
>> SHOULD NOT be sent, unless a puzzle is also sent.
>>
>> * added section 7.4, error handling in IKE_SA_INIT. RFC 7296 says "Because all
>> error notifications are completely unauthenticated, the recipient should
>> continue trying for some time before giving up. Draft says that if an attacker
>> manages to insert a fake error message in a TCP connection, then the initiator
>> will never receive correct messages on that flow and should act on the error
>> immediately -- unless the error can be corrected by repeating the request with
>> amended parameters.
>>
>> * moved section 10 to section 7.6, Considerations for Keep-Alives and Dead Peer
>> Detection, with an addition that IKEv2 exchange of informational messages
>> should be used instead of TCP keep-alive. (Note that moving the section means
>> the reviewer cannot use "diff" to find what changed, and that's not nice.)
> We understand this, but we think that the new document has more logical structure.
>
>> * moved section 8 to section 8.1. Added clarifications for cases when moving
>> from a path that supported UDP to one that required TCP, and vice versa.
>>
>> * added section 8.2 for IKE redirect, with clarification on what happens when
>> redirecting from a path that supported UDP to one that required TCP, and vice
>> versa.
>>
>> * moved last paragraphs of section 8 to section 8.3 on IKEv2 Session Resumption
>>
>> * renumbered section 10 and higher as section 9 and higher.
>>
>> * updated IANA considerations
>>
>> Security considerations are unchanged from RFC 8229. This is a missed
>> opportunity. The security considerations correctly state that "IKE Responders
>> that support TCP encapsulation may become vulnerable to new Denial-of-Service
>> (DoS) attacks that are specific to TCP", citing SYN flooding attacks, and later
>> mentions TCP Reset attacks against both initiators and responders. The security
>> section does not mention packet injection attacks against TCP connections,
>> although this kind of attack is actually discussed in section 7.3.
> In general packet injection attacks have no effects on applications, since both ESP and IKE
> provide data integrity and will ignore packets that fail ICV check.
>
> However, I agree that in some cases the attack may have some effect:
> - if an attacker alters the content of the Length field that separates packets,
>     then the receiver will incorrectly identify the margins of the following packets and
>     will drop all of them or even tear down the TCP connection if the content of the
>     Length field happen to be 0 or 1
> - if the content of an IKE message is changed, then it will be dropped by the receiver;
>     if the dropped message is the IKE request message, then the initiator will tear
>     down the IKE SA after timeout, since in most cases the request message will not be retransmitted
>     (as advised in section 7.2)
> - if an attacker alters the non-ESP marker then IKE packets will be dispatched to ESP
>     and sometimes visa versa, those packets will be dropped
> - if an attacker modifies IKE messages while new IKE SA is being established
>     (i.e. in the IKE_SA_INIT exchange), then in most cases this will result in
>     failure to establish IKE SA
>
> In other words, the result of packet injection attack will be some kind of DoS attack.
>
> We can add these considerations into the Section 11.
>
> Note, that if an attacker is so powerful, that it is able to modify packets
> on the wire, then it may mount DoS attack on IPsec regardless on the transport
> being used.
>
>> TCP specific attacks are not an issue as long as TCP encapsulation is only used
>> on network paths that do not support UDP. On the other hand, since TCP is more
>> vulnerable to denial of service than UDP, we have potential downgrade attacks
>> in which an attacker somehow convinces the initiator that UDP is not available,
>> when in fact it is. The initiator will move to using TCP, and the attacker can
>> then attack the TCP connection. It might be worth mentioning this in the
>> security section, and how the guidance provided in section 6.1 mitigates such
>> attacks.
> We can add a sentence that an attacker can force TCP encapsulation by blocking UDP.
>
>> Of course, IKE and IPSEC are already protected against UDP or IP packet
>> injection attacks, which are much easier to mount than TCP injection attacks.
>> However, UDP or IP packet injection will generally not affect the state of the
>> security associations. TCP packet injection attacks will force initiators and
>> responders to abandon the TCP connection, as explained for example in section
>> 7.3. It might be worth mentioning that the defenses against RST injection also
>> apply against other forms of packet injection.
> If the TCP connection is abandoned (for any reason) and the associated IKE SA
> is still up, then the IKE initiator will re-create it. So, it is not a big deal, but definitely
> can influence performance. On the other hand, an attacker who is able to alter
> the packets on the wire (TCP, UDP, any) can make IKE peers to tear down IKE SA
> (e.g. by spoiling every packet). So, I'm not sure using TCP gives significant
> advantages for an attacker here, in most cases it will result in DoS.

The bar against TCP injection attacks might be lower than you think. An 
attacker that sees the traffic can easily inject TCP packet with 
sequence number that fit in the flow control window and are ahead of 
what the actual sender produced. That means both on-path attackers and 
attackers that merely passively listen on traffic can do that. It is 
harder for attackers that are off path and don't actually see the 
traffic, but not impossible. They can spray one of the endpoints with 
fake traffic with a variety of port numbers and sequence numbers, and 
rely on birthday paradox to get some of it through. I agree that this is 
"just a DOS", but they could not mount that against IPSEC on UDP or IP.

-- Christian Huitema