[Jmap] Re: Working group last call draft-ietf-jmap-webpush-vapid

Phillip Tao <ptao@apple.com> Mon, 05 August 2024 21:24 UTC

Return-Path: <ptao@apple.com>
X-Original-To: jmap@ietfa.amsl.com
Delivered-To: jmap@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DE5B5C14F6EC for <jmap@ietfa.amsl.com>; Mon, 5 Aug 2024 14:24:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.256
X-Spam-Level:
X-Spam-Status: No, score=-2.256 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.148, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=apple.com
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 0rjD-QsJMykn for <jmap@ietfa.amsl.com>; Mon, 5 Aug 2024 14:24:05 -0700 (PDT)
Received: from rn-mailsvcp-mx-lapp01.apple.com (rn-mailsvcp-mx-lapp01.apple.com [17.179.253.22]) (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 ietfa.amsl.com (Postfix) with ESMTPS id 74262C14F73E for <jmap@ietf.org>; Mon, 5 Aug 2024 14:24:05 -0700 (PDT)
Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by rn-mailsvcp-mx-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0SHR00EW2KS4F810@rn-mailsvcp-mx-lapp01.rno.apple.com> for jmap@ietf.org; Mon, 05 Aug 2024 14:24:05 -0700 (PDT)
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-05_09,2024-08-02_01,2024-05-17_01
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=cc : content-transfer-encoding : content-type : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=20180706; bh=9v3BKje5WTeRBr3GRR8MMgj3NKtgqCxXZU8yXyqWphk=; b=RJ9kEJOKq6UBTXpTTmeKrcV9qpFI3deRdDYWGISlXj7f0gu/F7qXcOODTkvVc9+9hRzt hsguFX1yNPLaIuYiuOimVwi9dvbVZgk/xGvYBQW7xmrl644ZjNOetoBGL/NV+DUSXyH6 OyoqIOqoW//gn5dz/9QE94UOJgo+FpN0lP75x1J3dz3IKDLyZo5rDjb5PqmdTuLDnVfu GHKmE8HPEO6lVB594U5uGpE0lfOVFUTcc4yy/Feu+O2b0iFZLHXNJSmWfix8Bu+n4Jm9 uERAUFm8it7Sy1SPAAWxTiXMiUXDX2oZ18DyuIADjp5T65ldhnSOqpLhbGsaHlzHhBiM MA==
Received: from mr55p01nt-mmpp06.apple.com (mr55p01nt-mmpp06.apple.com [10.170.185.198]) by rn-mailsvcp-mta-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0SHR00H0RKS4IXI0@rn-mailsvcp-mta-lapp02.rno.apple.com>; Mon, 05 Aug 2024 14:24:04 -0700 (PDT)
Received: from process_milters-daemon.mr55p01nt-mmpp06.apple.com by mr55p01nt-mmpp06.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) id <0SHR2GU00KFO9D00@mr55p01nt-mmpp06.apple.com>; Mon, 05 Aug 2024 21:24:04 +0000 (GMT)
X-Va-A:
X-Va-T-CD: c602dbec03e849cd0c7316fa6fe95e3a
X-Va-E-CD: 2b62727f37d022ef1b8e83014f487017
X-Va-R-CD: a4989e8565d886b050c733a5054e52c2
X-Va-ID: 2a07b8b0-3acc-4ec9-b4b8-155f20e85dc0
X-Va-CD: 0
X-V-A:
X-V-T-CD: c602dbec03e849cd0c7316fa6fe95e3a
X-V-E-CD: 2b62727f37d022ef1b8e83014f487017
X-V-R-CD: a4989e8565d886b050c733a5054e52c2
X-V-ID: 63686335-c3c4-4fae-b952-5bd29f9647cb
X-V-CD: 0
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-05_09,2024-08-02_01,2024-05-17_01
Received: from smtpclient.apple (unknown [17.11.104.38]) by mr55p01nt-mmpp06.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPSA id <0SHR2H04IKS33M00@mr55p01nt-mmpp06.apple.com>; Mon, 05 Aug 2024 21:24:04 +0000 (GMT)
Content-type: text/plain; charset="utf-8"
MIME-version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
From: Phillip Tao <ptao@apple.com>
In-reply-to: <CAN-aAr-PqP8O6rd4QzmC3PWBvxtQWL2jXgHLke2_qKczDg3ctw@mail.gmail.com>
Date: Mon, 05 Aug 2024 14:24:03 -0700
Content-transfer-encoding: quoted-printable
Message-id: <F38FBA93-E40F-49FB-A5E4-E19E9E7E824E@apple.com>
References: <fb1b10ae-ea36-4ee4-b84f-b62f036cfaf5@app.fastmail.com> <4b201702-ad4a-4b0e-86da-fac9f07d265e@app.fastmail.com> <7fb768b0-3c97-4668-8616-b300b03aeb1a@app.fastmail.com> <6F9D4D61-0FFC-4798-8001-73D230328EF0@apple.com> <f3c75b7b-86c6-4255-a5a4-0e5a975c556e@app.fastmail.com> <74D126D4-5BDE-44F8-8887-2B93D58DD7C6@apple.com> <58ddcbd1-b0cc-4638-ad45-8e2d0a755897@dogfoodapp.fastmail.com> <533AB12E-F2C1-4F27-8106-AB33721804F7@apple.com> <CAN-aAr-PqP8O6rd4QzmC3PWBvxtQWL2jXgHLke2_qKczDg3ctw@mail.gmail.com>
To: Daniel Gultsch <daniel@gultsch.de>
X-Mailer: Apple Mail (2.3774.600.62)
Message-ID-Hash: R5GFMOJXIMHKCXPK5DY73BJM442J5G5E
X-Message-ID-Hash: R5GFMOJXIMHKCXPK5DY73BJM442J5G5E
X-MailFrom: ptao@apple.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-jmap.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Neil Jenkins <neilj=40fastmailteam.com@dmarc.ietf.org>, Bron Gondwana <brong@fastmailteam.com>, IETF JMAP Mailing List <jmap@ietf.org>
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [Jmap] Re: Working group last call draft-ietf-jmap-webpush-vapid
List-Id: JSON Message Access Protocol <jmap.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/kqzxenlNC9uTDERjD2PbFVs2LOE>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jmap>
List-Help: <mailto:jmap-request@ietf.org?subject=help>
List-Owner: <mailto:jmap-owner@ietf.org>
List-Post: <mailto:jmap@ietf.org>
List-Subscribe: <mailto:jmap-join@ietf.org>
List-Unsubscribe: <mailto:jmap-leave@ietf.org>


> On Aug 1, 2024, at 4:21 AM, Daniel Gultsch <daniel@gultsch.de> wrote:
> 
> I've made an update to draft-ietf-jmap-webpush-vapid that explains how
> key rotations should be handled.

I think the new text in section 4 is good, but doesn't fully address the race condition. The "application server key that was advertised in the capabilites [sp] object at the time	the PushSubscription was created" may not be the application server key that the client used to create the push subscription. The key may have rotated between when the client last fetched the Session and when they created the PushSubscription. With no intervening requests, it would not know that the application server key has changed.

I think it would also be good to add some text for how the JMAP server should handle a 403 from the push server, specially for/possibly only for the PushVerification.
> 
> On Fri, Jul 26, 2024 at 5:31 PM Phillip Tao <ptao@apple.com> wrote:
>> 
>> My slight concern with 3(b) is that one reason you may want to rotate your key is that it was compromised. Knowingly continuing to use a key that's compromised seems a little odd, and it generally seems more prudent to immediately notify the user agent that they need to recreate their push subscriptions, so they don't receive fraudulent/dangerous push notifications. I wonder if this is why RFC 8292 chose to recommend that the application server prompt the client to create a new subscription.
> 
> (Web)Push Encryption, which is already specified in RFC 8620 should be
> used to protect against fraudulent push notifications.

That makes sense.

> VAPID (in my
> understanding) is mostly used as a mechanism for push services to
> protect against (D)DoS.

It protects against DDoS by requiring authentication to push. If the key is compromised, it effectively is the same as not having VAPID.

> So if your application server key would leak
> and an attacker would abuse it it would probably "just" get blocked by
> the push service.

To block the application server, the push service needs to distinguish legitimate and fraudulent push messages. They may not always get it right (for example, they may be relying on suspicious volume as an indicator, and so the first few messages may get through). I imagine some push services may exempt VAPID push subscriptions from the same spam detection that non-VAPID subscriptions would be subject to.

> I don’t see any immediate harm for a JMAP server to
> continue using a rotated key for a certain period of time.

Since JMAP push subscriptions require encryption, I agree.

> Also to my
> knowledge there is no system in place to revoke VAPID keys with any of
> the major push services. So even if the JMAP server would stop using
> it an attacker could continue to use it until the push URL expires
> (which may or may not happen when the user agents request a new URL)

Hence why I suspect that RFC 8292 recommends the application server prompt the client to recreate the push resource (which I think would imply DELETEing the old one).
> 
> I think it’s good that we specified how key rotation works (Thank you
> Bron for bringing this up) but personally I’m seeing this mostly as a
> means to recover from key loss rather than compromise.

Sure, I think that's likely the more common case, I just wanted to make sure we're not opening up additional "security considerations" in the odd compromise case. But I think the encryption requirement covers that.
> 
> cheers
> Daniel