[IPsec] Re: draft-smyslov-ipsecme-ikev2-downgrade-prevention

Christopher Patton <cpatton@cloudflare.com> Thu, 31 July 2025 12:39 UTC

Return-Path: <cpatton@cloudflare.com>
X-Original-To: ipsec@mail2.ietf.org
Delivered-To: ipsec@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 076824DCA424 for <ipsec@mail2.ietf.org>; Thu, 31 Jul 2025 05:39:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=cloudflare.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1ZVurk0oumR7 for <ipsec@mail2.ietf.org>; Thu, 31 Jul 2025 05:39:26 -0700 (PDT)
Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id A220B4DCA41B for <ipsec@ietf.org>; Thu, 31 Jul 2025 05:39:26 -0700 (PDT)
Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-4abc0a296f5so9320311cf.0 for <ipsec@ietf.org>; Thu, 31 Jul 2025 05:39:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1753965566; x=1754570366; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yiwel4GFbvchBL/TeceMzxUyTluEIhX4Vhnq9Uq8/6c=; b=fyfVtMMsYv38eT3Ft89op+D7JlkLyxf4jNqn9q1cYnsT/CcvYHppCfbKkejHyJ3nBo ZuG0Ztgf+Q2nGThDui3pVj6czs6G9/0z6I72MyNS3rpbhfZisLmKdfzx/e2GU87Rv+iV EjzJxGh1yg1cJPC/cpYYBpAhMlAra+zjNai4ShntSadp1J2/NrUIzTiJbmSRptk4gddh 2XK5xslytfhJXsFIDJcetaBhSyDh995Ze6kSJLqaou3O4a0rRtNQQ4Pr/sx/SYhQMJ2o 5jgdTeqtFETfGN7FVKOkClsZNQvxcJhGyqNAbQsZd16VZBBK5SJaDBugXvi185BfjAQX o8UA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753965566; x=1754570366; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yiwel4GFbvchBL/TeceMzxUyTluEIhX4Vhnq9Uq8/6c=; b=VtsY4E1g+pAneMpcQiGCvmaWxIQOvymz1u7SHP9lQxp8DFhsXqcOg5VEVmo5PCf+c/ BGE612gTxGSUqHCF0C4csbJ2WjXy0NHx7QhJNDAMWAf9/J6UFREk+puSepNzMnB00GMW F/JO4lLoofOv+NDeX310eenIXyMDNlF+2/y7PQjPafcVC8jr+218Btk1TPxUZ6Ji6LPp PBHhSP6APMDFR5rmLxjTuD2vgPEp5eGObMU3S7hAcylXoPFdZFSxWL/Dg+UPZu/zr+RS sxB7C1Vzg6iarbtAeBnn/nt/x2VPvBQqqWbxn+gsphB1fbo3ytFfLowB6r65pCskKtXL RfyA==
X-Forwarded-Encrypted: i=1; AJvYcCXaH1oXkBLPzyEfEAHHP4/HRLGP5AvHtoe8HImBkBiCvGzGYJt8tFTIBHuueRB8/QeYD474sQ==@ietf.org
X-Gm-Message-State: AOJu0YwCaVb/y/1YUKqBRdvKrtCV4lMINiFVEkGKbeEZdyLBhiwnxAmE tJ/U9+GxRlevLLPqKlQqeD01QecFNhNQ7pN6q0rMu5OO4vlXGmPjFi9Ciu1unmPffuqJW0VPiMc QNJ36QaLXmgBAQhPOmNb48fTojBK54JlUALuBE+yByQ==
X-Gm-Gg: ASbGncvB+TgnXtb1mYJgNKCcwd/uFD0BFADqnoHjCVtmfFaZwG3xraoXDDZKXlKnqUN y2deMSnaLdBGaP4rMDiEhrxfxVyssAyBaCmWIcwNSs5LzzO9+F1BCb76//Toz2FTD11ad0xdaI4 cvF7HHC0Op1oguAUjz2i6b4BIFY1lAQjunbbQgtu7cLWOt28OtiXYliWGM7x0kqgyeLTtv+09z2 qglhgXvEdhHJgN88OnamlqJtw==
X-Google-Smtp-Source: AGHT+IGwqHWbPoTrFEwpQ86+y94UceeDA8CpeaYT9atQd1r0EMx0qknqehNXn/038yAZHJA1DSyqUrLZLOmn/lL7AqM=
X-Received: by 2002:ac8:5713:0:b0:4ab:cf30:187d with SMTP id d75a77b69052e-4aedb99c748mr107016521cf.19.1753965565876; Thu, 31 Jul 2025 05:39:25 -0700 (PDT)
MIME-Version: 1.0
References: <PH3PPFA3FE8A23FE4F3833C4C5FECEC2DDFC125A@PH3PPFA3FE8A23F.namprd11.prod.outlook.com> <CAG2Zi23b7OuK5SX2f2HWUbDonXXzL82U_Ts+eWd9iug9zeYDAQ@mail.gmail.com> <BYAPR08MB5288E9023D9D5882B65A48609525A@BYAPR08MB5288.namprd08.prod.outlook.com> <0a9801dc0123$755e9c10$601bd430$@gmail.com> <BYAPR08MB5288FFE647A50107717DF1E29524A@BYAPR08MB5288.namprd08.prod.outlook.com> <19890.1753898456@obiwan.sandelman.ca> <BYAPR08MB5288F727F36D69271D2BAE7E9524A@BYAPR08MB5288.namprd08.prod.outlook.com> <BYAPR08MB5288EB06FFCD8BAE1F40C15D9524A@BYAPR08MB5288.namprd08.prod.outlook.com> <CAG2Zi21_Ak++pmmMt4NivfTMU7ChZEwSwPVn9qC6Y2VQ3U5qVg@mail.gmail.com> <BYAPR08MB52881DE7CE105FD5854BE01A9524A@BYAPR08MB5288.namprd08.prod.outlook.com>
In-Reply-To: <BYAPR08MB52881DE7CE105FD5854BE01A9524A@BYAPR08MB5288.namprd08.prod.outlook.com>
From: Christopher Patton <cpatton@cloudflare.com>
Date: Thu, 31 Jul 2025 08:39:14 -0400
X-Gm-Features: Ac12FXzz_9pUggL_eZztE7DV6_fXQyZiBeCmN_DJnIsTv2m_KVay6XA_pLhCe8E
Message-ID: <CAG2Zi22kbWBDq1CejN93a89OO2-VgZJ7P7bvzW_xayoDPT_dWw@mail.gmail.com>
To: "Jun Hu (Nokia)" <jun.hu@nokia.com>
Content-Type: multipart/alternative; boundary="00000000000080c723063b38ee24"
Message-ID-Hash: IPTWGFRSZEJMOY5N2PMGSEC64PPLE4CZ
X-Message-ID-Hash: IPTWGFRSZEJMOY5N2PMGSEC64PPLE4CZ
X-MailFrom: cpatton@cloudflare.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-ipsec.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Michael Richardson <mcr+ietf@sandelman.ca>, Valery Smyslov <smyslov.ietf@gmail.com>, "Scott Fluhrer (sfluhrer)" <sfluhrer@cisco.com>, ipsec <ipsec@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [IPsec] Re: draft-smyslov-ipsecme-ikev2-downgrade-prevention
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/NrOhC8pHldOUj-0DeHt7l7-v_20>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipsec>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Owner: <mailto:ipsec-owner@ietf.org>
List-Post: <mailto:ipsec@ietf.org>
List-Subscribe: <mailto:ipsec-join@ietf.org>
List-Unsubscribe: <mailto:ipsec-leave@ietf.org>

Jun,


> Ok, the attack with this procedure could work, however from Y point of
> view it is talking with A instead of X, so if there are additional actions
> on Y tied to peer’s ID, for example if Y install some firewall/ACL rules
> based on IDi, and only X is allowed to access some backend service via the
> installed firewall/ACL rule, this attack won’t get around that.
>

Very true, but before Y figures out it is talking to the wrong peer, X
might reveal sensitive information about itself to the adversary that it
would have only wanted to reveal to Y.

In general, I don't think we should count on whatever application we build
on top of IPsec to save us. When we build these applications, we reasonably
assume IPsec provides a secure channel between the endpoints. This attack
would seem to invalidate that assumption, since (1) the peers have not
actually authenticated one another (X believes it's talking to Y, but Y
believes it's talking to A) and (2) the adversary can decrypt all packets
exchanged between the endpoints. We could try to shove in some
post-handshake authentication, but that just pushes the problem to the
application. I think it's better to fix IPsec itself rather than rely on
ad-hoc, per-application defenses.



> And beside configure properly, another mitigation against this attack
> without introducing new protocol changes is just Y mandate use of PPK
> (RFC8784).
>

I have two thoughts here.

First, I imagine that mandating the use of a PPK isn't going to be viable
for all deployment scenarios. Otherwise, I don't know that there would be
any point in supporting digital signatures for authentication in IKEv2. If
you can distribute a PPK, then you can also distribute a MAC key.

Second, RFC8784 does indeed provide some protection here, but the attack
would still invalidate forward secrecy. That is, if an attacker ever learns
the PPK used in the handshake, it would then be able to decrypt the
traffic. RFC8784 only provides forward secrecy if the PPK is combined with
a fresh, strong key exchange, but the attack downgrades the key exchange to
one the attacker can break.

This second point is a bit more subtle, but it reveals something
fundamental about authenticated key exchange in general: the possibility of
downgrade attacks implies that whatever security property we think we're
getting from the protocol might not actually hold -- whether it's forward
secrecy or something else that our application needs.

Best,
Chris P.