<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.21 (Ruby 3.3.6) -->


<!DOCTYPE rfc  [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">

<!ENTITY RFC8620 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8620.xml">
<!ENTITY RFC8030 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8030.xml">
<!ENTITY RFC8292 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8292.xml">
<!ENTITY RFC2119 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC7515 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7515.xml">
]>


<rfc ipr="trust200902" docName="draft-ietf-jmap-webpush-vapid-08" category="std" consensus="true" submissionType="IETF">
  <front>
    <title>Use of VAPID in JMAP WebPush</title>

    <author initials="D." surname="Gultsch" fullname="Daniel Gultsch">
      <organization></organization>
      <address>
        <email>daniel@gultsch.de</email>
      </address>
    </author>

    <date year="2025" month="January" day="05"/>

    <area>Internet</area>
    <workgroup>JMAP</workgroup>
    

    <abstract>


<?line 34?>

<t>This document defines a method for JMAP servers to advertise their capability to authenticate WebPush notifications using the Voluntary Application Server Identification protocol.</t>



    </abstract>



  </front>

  <middle>


<?line 38?>

<section anchor="introduction"><name>Introduction</name>

<t>JMAP <xref target="RFC8620"/> specifies how clients can subscribe to events using a protocol that is compatible with WebPush <xref target="RFC8030"/>. Some push services require that the application server authenticates all push messages using the Voluntary Application Server Identification protocol <xref target="RFC8292"/>. To facilitate that, the client (or user agent in WebPush terminology) needs the VAPID public key of the application server to pass it along to the push service when retrieving a new endpoint.</t>

</section>
<section anchor="conventions-used-in-this-document"><name>Conventions Used in This Document</name>

<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
"MAY", and "OPTIONAL" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.
These words may also appear in this document in
lower case as plain English words, absent their normative meanings.
<?line -8?></t>

</section>
<section anchor="discovering-support-for-vapid"><name>Discovering Support for VAPID</name>

<t>The JMAP capabilities object is returned as part of the standard JMAP session object (see Section 2 of <xref target="RFC8620"/>). Servers supporting this specification MUST add a property called "urn:ietf:params:jmap:webpush-vapid" to the capabilities object. The value of this property is an object that MUST contain the following information:</t>

<t><list style="symbols">
  <t>applicationServerKey: "String"  <vspace blankLines='1'/>
The ECDSA public key (current systems use the P-256 curve) <xref target="FIPS186"/>, in its uncompressed form as described in <xref target="X9.62"/> Annex A and encoded using base64url encoding <xref target="RFC7515"/>, that the push service will use to authenticate the application server.</t>
</list></t>

</section>
<section anchor="issuing-push-notifications"><name>Issuing Push Notifications</name>

<t>Every time the server sends a push message to a PushSubscription URL it MUST authenticate the POST request using the protocol outlined in <xref target="RFC8292"/>. This includes both StateChange events and PushVerification notifications. The server MUST use the application server key that was advertised in the capabilities object at the time the PushSubscription was created.</t>

</section>
<section anchor="key-rotation"><name>Key Rotation</name>

<t>When a server needs to replace its VAPID key, it MUST update the sessionState per <xref target="RFC8620"/>. The client MUST monitor the JMAP session object for changes to the VAPID key and MUST recreate its push subscription after detecting such a change.</t>

<t>After key rotation, the server MAY continue to send push notifications for existing push subscriptions using the old application server key for a transitional period. This allows clients time to recreate their respective push subscriptions. After the transitional period (or immediately for implementations that do not have one), the server MUST destroy push subscriptions that use the old key.</t>

<t>When destroying push subscriptions that include the data type <spanx style="verb">PushSubscription</spanx>, the server MAY issue one final StateChange push notification using the old URL and application server key to notify the client of changes to the PushSubscription data type. This prompts the client to make a <spanx style="verb">PushSubscription/changes</spanx> method call. The response to this call will contain an updated sessionState, which refers to a session object that contains the new VAPID key.</t>

<t>A race condition can occur when the server updates its VAPID key after the client has refreshed the session object but before calling the PushSubscription/set method. This situation causes the server to send a PushVerification object to a push resource URL that is now associated with an outdated VAPID key. Consequently, the push service will reject the PushVerification with a 403 (Forbidden) status code, as specified in <xref target="RFC8292"/>.</t>

<t>To alleviate this problem, the client MUST check if the sessionState in the response from the PushSubscription/set method points to a session object with an applicationServerKey that matches their expectations. If there is a mismatch, the client MAY retry creating the PushSubscription. Additionally, the client MAY destroy the PushSubscription from the earlier, failed attempt.</t>

</section>
<section anchor="security-considerations"><name>Security Considerations</name>

<t>During the key rotation process, synchronization issues between the client and server may arise. Specifically, a client might restrict a push subscription with the push service to an outdated key, while the server sends the PushVerification object signed with the newly rotated key. This mismatch leads to the push service rejecting the PushVerification request with HTTP status code 403, as specified in <xref target="RFC8292"/>, Section 4.2.</t>

<t>Per the requirements of <xref target="RFC8620"/>, Section 7.2, the server MUST NOT retry the rejected PushVerification request. Consequently, the PushVerification object will not be delivered to the client.</t>

<t>To mitigate such issues, the client is responsible for detecting and resolving any synchronization discrepancies, as outlined in the 'Key Rotation' section of this document.</t>

<t>The inclusion of the <spanx style="verb">urn:ietf:params:jmap:webpush-vapid</spanx> property in the JMAP capabilities object is limited to providing information about the server's support for Voluntary Application Server Identification (VAPID). This property does not reveal sensitive information, nor does it introduce new security or privacy risks beyond those inherent to JMAP and WebPush. The security considerations for JMAP (<xref target="RFC8620"/>, especially Section 8.6 and Section 8.7 of that document), WebPush (<xref target="RFC8030"/>) and VAPID (<xref target="RFC8292"/>) apply to this document.</t>

</section>
<section anchor="iana-considerations"><name>IANA Considerations</name>

<section anchor="registration-of-the-jmap-capability-for-vapid"><name>Registration of the JMAP Capability for VAPID</name>

<t>This specification requests IANA to register a new capability in the JMAP Capabilities registry with the following data:</t>

<t>Capability Name: <spanx style="verb">urn:ietf:params:jmap:webpush-vapid</spanx></t>

<t>Specification document: this document</t>

<t>Intended use: common</t>

<t>Change Controller: IETF</t>

<t>Security and privacy considerations: this document, Section 6</t>

</section>
</section>


  </middle>

  <back>



    <references title='Normative References' anchor="sec-normative-references">

<reference anchor="FIPS186" target="https://doi.org/10.6028/NIST.FIPS.186-4">
  <front>
    <title>Digital Signature Standard (DSS)</title>
    <author >
      <organization>National Institute of Standards and Technology (NIST)</organization>
    </author>
    <date year="2013" month="July"/>
  </front>
  <seriesInfo name="FIPS" value="186-4"/>
</reference>
<reference anchor="X9.62" >
  <front>
    <title>Public Key Cryptography for the Financial Services Industry: The Elliptic Curve Digital Signature Algorithm (ECDSA)</title>
    <author >
      <organization>American National Standards Institute</organization>
    </author>
    <date year="2005" month="November"/>
  </front>
  <seriesInfo name="ANSI" value="X9.62-2005"/>
</reference>
&RFC8620;
&RFC8030;
&RFC8292;
&RFC2119;
&RFC8174;
&RFC7515;


    </references>





  </back>

<!-- ##markdown-source:
H4sIAAAAAAAAA6VZ0XbbuBF951dMlYe1eyRFVhLH0enpVrWdRt3EdiNnt3kL
RIxEbEiABUBp2Rz/S7+lX9YzA5AiLXm3Pc1LJIoYDO7cuTMDj0ajxCuf4wwG
nxyCWcOP87vFFSgNf/0wv4OfcHVXuWyQSJPeiILek1as/UihX49+LkQ52uGq
rFw22opSydHkYpBI4XEG08n01WhyNpq8ShJhUcxgoT1ajT7ZbWZsPnHVqlDO
KaN9XeIMFtf3b5NU+Bk4LxNV2hkMvK2cn04mbybTQZKIymfGzhIYJQCaPboS
WmEOf6ly79IsAcBCqHwGkp//aROejyUmiTa2EF5tcZYAvF3cLc8uzukjQIPC
ldooL3JYqo0WvrIISy+0FFbCydVyeTrgt1sv+N8IjN3MYHAjvDJa5LDQzitf
eQa0We9AaAn3mGba5GZTw8nNYnkfDTaQnb0YTV4Hh4TdoJ/BIPO+dLPnz6VR
Y2M3z88m4/PJ9OI5rR7TGcZnF+ejl8GOQ6vQKb02jX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