<?xml version="1.0" encoding="UTF-8"?>

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

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" docName="draft-ietf-stir-messaging-08" number="9475" submissionType="IETF" category="std" consensus="true" ipr="trust200902" obsoletes="" updates="" xml:lang="en" tocInclude="true" tocDepth="4" symRefs="true" sortRefs="true" version="3">

  <front>


    
    <title abbrev="STIR Messaging">Messaging Use Cases and Extensions for Secure Telephone Identity Revisited (STIR)</title>
    <seriesInfo name="RFC" value="9475"/>
    <author initials="J." surname="Peterson" fullname="Jon Peterson">
      <organization abbrev="Neustar">Neustar, Inc.</organization>
      <address>
        <email>jon.peterson@team.neustar</email>
      </address>
    </author>
    <author fullname="Chris Wendt" initials="C." surname="Wendt">
      <organization>Somos</organization>
      <address>
        <email>chris-ietf@chriswendt.net</email>
      </address>
    </author>
    <date year="2023" month="December"/>
    <area>art</area>
    <workgroup>stir</workgroup>
    <keyword>SIP</keyword>
    <abstract>
      
      
      <t>
	   Secure Telephone Identity Revisited (STIR) provides a means of attesting the identity of a telephone caller via a signed token in order to prevent impersonation of a calling party number, which is a key enabler for illegal robocalling. Similar impersonation is sometimes leveraged by bad actors in the text and multimedia messaging space. This document explores the applicability of STIR's Personal Assertion Token (PASSporT) and certificate issuance framework to text and multimedia messaging use cases, including support for both messages carried as a payload in SIP requests and messages sent in sessions negotiated by SIP.
      </t>
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>
      <t>
	The STIR problem statement <xref target="RFC7340" format="default"/> describes widespread problems enabled by impersonation in the telephone network, including illegal robocalling, voicemail hacking, and swatting.
	As telephone services are increasingly migrating onto the Internet and using Voice over IP (VoIP) protocols such as <xref target="RFC3261" format="default">SIP</xref>, it is necessary for these protocols
	to support stronger identity mechanisms to prevent impersonation. <xref target="RFC8224" format="default"/> defines a SIP Identity header capable of carrying <xref target="RFC8225" format="default">PASSporT</xref> objects in SIP as a means to cryptographically attest that the originator of a telephone call is authorized to use the calling party number (or, for SIP cases, SIP URI) associated with the originator of the call.
      </t>
      <t>
	However, the problem of bulk, unsolicited commercial communications is not limited to telephone calls. Spammers and fraudsters are increasingly turning to messaging applications to deliver undesired content to consumers. In some respects, mitigating these unwanted messages resembles the email spam problem; for example, textual analysis of the message contents can be used to fingerprint content that is generated by spammers. However, encrypted messaging is becoming more common, and analysis of message contents may no longer be a reliable way to mitigate messaging spam in the future. As STIR sees further deployment in the telephone network, the governance structures put in place for securing telephone-network resources with STIR could be repurposed to help secure the messaging ecosystem.
      </t>
      <t>
	One of the more sensitive applications for message security is emergency services. As next-generation emergency services increasingly incorporate messaging as a mode of communication with public safety personnel (see <xref target="RFC8876" format="default"/>), providing an identity assurance could help to mitigate denial-of-service attacks and ultimately help to identify the source of emergency communications in general (including swatting attacks, see <xref target="RFC7340" format="default"/>).
      </t>
      <t>
	Therefore, this specification explores how the PASSporT mechanism defined for STIR could be applied in providing protection for textual and multimedia messaging, but it focuses particularly on those messages that use telephone numbers as the identity of the sender. Moreover, it considers the reuse of existing STIR certificates, which are beginning to see widespread deployment for signing PASSporTs that protect messages. For that purpose, it defines a new PASSporT type and an element that protects message integrity. It contains a mixture of normative and informative guidance that specifies new claims for use in PASSporTs as well as an overview of how STIR might be applied to messaging in various environments.
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Terminology</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
    </section>
    <section anchor="applic" numbered="true" toc="default">
      <name>Applicability to Messaging Systems</name>
      <t>

	
      At a high level, <xref target="RFC8225" format="default">PASSporT</xref> claims provide similar value to number-based messaging as they do to telephone calls. A signature over the calling and called party numbers, along with a timestamp, could already help to prevent impersonation in the mobile-messaging ecosystem.</t>
      <t>When it comes to protecting message contents, broadly, there are a few ways that the PASSporT mechanism of STIR could apply to messaging:</t>
	<ol><li>a PASSporT could be used to securely negotiate a session over which messages will be exchanged (see <xref target="session"/>), and</li>
	<li>in sessionless scenarios, a PASSporT could be generated on a per-message basis with its own built-in message security (see <xref target="message"/>).</li></ol>
      <section anchor="session" numbered="true" toc="default">
        <name>Message Sessions</name>
        <t>
	  
	  In the first case, SIP negotiates a session in which the media will be text messages or MIME content, as, for example, with the <xref target="RFC4975" format="default">Message Session Relay Protocol (MSRP)</xref>.  This usage of STIR would deviate little from <xref target="RFC8224" format="default"/>. An INVITE request sent with an Identity header containing a PASSporT with the proper calling and called party numbers would then negotiate an MSRP session the same way that an INVITE for a telephone call would negotiate an audio session.  This could be applicable to MSRP sessions negotiated for <xref target="RCC.07" format="default">Rich Communication Suite (RCS)</xref>. Note that, if TLS is used to secure MSRP (per RCS <xref target="RCC.15" format="default"/>), fingerprints of those TLS keys could be secured via the "mky" claim of PASSporT using the framework described in <xref target="RFC8862" format="default"/>. Similar practices would apply to sessions that negotiate real-time text over RTP (<xref target="RFC4103" format="default"/>, <xref target="RFC5194" format="default"/>); any that can operate over DTLS/SRTP  (Secure Real-time Transport Protocol) should work with the "mky" PASSporT claim. For the most basic use cases, STIR for messaging should not require any further protocol enhancements.
        </t>
        <t>
	  Current usage of <xref target="RFC8224" format="default"/> Identity is largely confined to INVITE requests that initiate telephone calls. RCS-style applications would require PASSporTs for all conversation participants, which could become complex in multiparty conversations. Any solution in this space would likely require the implementation of <xref target="I-D.ietf-stir-rfc4916-update" format="default">STIR-connected identity</xref>, but the specification of PASSporT-signed session conferencing is outside the scope of this document.
        </t>
        <t>
	  Also note that the assurance offered by <xref target="RFC8862" format="default"/> is "end-to-end" in the sense that it offers assurance between an authentication service and verification service. If those are not implemented by the endpoints themselves, there are still potential opportunities for tampering before messages are signed and after they are verified. However, for the most part, STIR does not intend to protect against machine-in-the-middle attacks so much as spoofed origination; so the protection offered may be sufficient to mitigate nuisance messaging.
        </t>
      </section>
      <section anchor="message" numbered="true" toc="default">
        <name>PASSporTs and Individual Messages</name>	
        <t>
	  In the second case described in <xref target="applic"/>, SIP also has a method for sending messages in the body of a SIP request: the <xref target="RFC3428" format="default">MESSAGE method</xref>. For example, MESSAGE is used in some North American emergency services use cases. The interaction of STIR with MESSAGE is not as straightforward as the potential use case with MSRP. An Identity header could be added to any SIP MESSAGE request, but without some extension to the PASSporT claims, the PASSporT would offer no protection to the message content; it would potentially be reusable for cut-and-paste attacks where the Identity header field from a legitimate request for one user is reused in a request for a different user. As the bodies of SIP requests are MIME encoded, <xref target="RFC8591" format="default">S/MIME</xref> has been proposed as a means of providing integrity for MESSAGE (and some MSRP cases as well). The use of <xref target="RFC3862" format="default">Common Presence and Instant Messaging (CPIM)</xref> as a MIME body allows the integrity of messages to withstand interworking with protocols that are not SIP. The interaction of STIR certificates with S/MIME (see <xref target="RFC8226" format="default"/>) for messaging applications would require further specification; additionally, PASSporT can provide its own integrity check for message contents through a new claim defined to provide a hash over message contents.
        </t>
        <t>
	  In order to differentiate a PASSporT for an individual message from a PASSporT used to secure a telephone call or message stream, this document defines a new "msg" PASSporT type. "msg" PASSporTs may carry a new optional JSON Web Token (JWT) <xref target="RFC7519" format="default"/> claim "msgi", which provides a digest over a MIME body that contains a text or multimedia message. Authentication services <bcp14>MUST NOT</bcp14> include "msgi" elements in PASSporT types other than "msg", but "msgi" is <bcp14>OPTIONAL</bcp14> in "msg" PASSporTs, as integrity for messages may be provided by some other service (e.g. <xref target="RFC8591" format="default"/>). Verification services <bcp14>MUST</bcp14> ignore the presence of "msgi" in non-"msg" PASSporT types.
        </t>
        <t>
	  The claim value of the "msgi" claim key is a string that defines the crypto algorithm used to generate the digest concatenated by a hyphen with a digest string.  Implementations <bcp14>MUST</bcp14> support the hash algorithms SHA-256, SHA-384,
      and SHA-512.  These hash algorithms are identified by "sha256", "sha384",
      and "sha512", respectively.  SHA-256, SHA-384, and SHA-512 are part of
      the SHA-2 set of cryptographic hash functions <xref target="RFC6234" format="default"/> defined by the
      US National Institute of Standards and Technology (NIST). 
<xref target="SHA2" format="default"/>  implementations
      <bcp14>MAY</bcp14> support additional recommended hash algorithms in the  <eref target="https://www.iana.org/assignments/cose">"COSE Algorithms" registry</eref>;
      that is, the hash algorithm has "Yes" in the "Recommended" column of
      the IANA registry.  Hash algorithm identifiers <bcp14>MUST</bcp14> use only lowercase
      letters, and they <bcp14>MUST NOT</bcp14> contain hyphen characters. The character following the algorithm string <bcp14>MUST</bcp14> be a hyphen character ("-" or ASCII character 45).
        </t>
        <t>
      The subsequent characters in the claim value are the base64-encoded <xref target="RFC4648"/> digest of a canonicalized and concatenated string or binary-data-based MIME body of the message.
	  An "msgi" message digest is computed over the entirety of the MIME body (be it carried via SIP or not); per <xref target="RFC3428" format="default"/>, this may be any sort of MIME body, including a multipart body in some cases, especially when multimedia content is involved. Those MIME bodies may or may not contain encrypted content or as the sender desires.
	  The digest becomes the value of the JWT "msgi" claim, as per this example:
        </t>
        <t>
	  "msgi" : "sha256-H8BRh8j48O9oYatfu5AZzq6A9RINQZngK7T62em8MUt1FLm52t+eX6xO"
        </t>
        <t>
	  Per <xref target="RFC8224" format="default"/>, this specification leaves it to local policy to determine how messages are handled after verification succeeds or fails. Broadly, if a SIP-based verification service wants to communicate back to the sender that the "msgi" hash does not correspond to the received message, using a SIP 438 response code would be most appropriate. 
        </t>
        <t>
	  Note that, in some CPIM environments, intermediaries may add or consume CPIM headers used for metadata in messages. MIME-layer integrity protection of "msgi" would be broken by a modification along these lines. Any such environment would require a profile of this specification that reduces the scope of protection only to the CPIM payload, as discussed in <xref target="RFC8591" sectionFormat="of" section="9.1"/>.
        </t>
	
        <t>
	  Finally, note that messages may be subject to store-and-forward treatment that differs from delivery expectations of SIP transactions. In such cases, the expiry freshness window recommended by <xref target="RFC8224" format="default"/> may be too strict, as routine behavior might dictate the delivery of a MESSAGE minutes or hours after it was sent. The potential for replay attacks can, however, be largely mitigated by the timestamp in PASSporTs; duplicate messages are easily detected, and the timestamp can be
   used to order messages displayed in the user inbox in a way that
   precludes showing stale messages as fresh.   Relaxing the expiry timer would require support for such features on the receiving side of the message.
        </t>
        <section anchor="convey" numbered="true" toc="default">
          <name>PASSporT Conveyance with Messaging</name>
          <t>
		If the message is being conveyed in SIP, via the MESSAGE method, then the PASSporT could be conveyed in an Identity header in that request. The authentication and verification service procedures for populating that PASSporT would follow the guidance in <xref target="RFC8224" format="default"/>, with the addition of the "msgi" claim defined in <xref target="message" format="default"/>.
          </t>
  
          <t>
		In text messaging today, Multimedia Messaging Service (MMS) messages are often conveyed with SMTP. Thus, there is a suite of additional email security tools available in this environment for sender authentication, such as "<xref target="RFC7489" format="title" />" <xref target="RFC7489" format="default"/>. The interaction of these mechanisms with STIR certificates and/or PASSporTs would require further study and is outside the scope of this document.
          </t>
          <t>
		For other cases where messages are conveyed by some protocol other than SIP, that protocol itself might have some way of conveying PASSporTs. There will surely be cases where legacy transmission of messages will not permit an accompanying PASSporT; in such a situation, something like out-of-band <xref target="RFC8816" format="default"/> conveyance would be the only way to deliver the PASSporT. For example, this may be necessary to support cases where legacy Short Message Peer-to-Peer <xref target="SMPP" format="default"/> systems cannot be upgraded.
          </t>
          <t>
		A MESSAGE request can be sent to multiple destinations in order to support multiparty messaging. In those cases, the "dest" claim of the PASSporT can accommodate the multiple targets of a MESSAGE without the need to generate a PASSporT for each target of the message. However, if the request is forked to multiple targets by an intermediary later in the call flow, and the list of targets is not available to the authentication service, then that forking intermediary would need to use <xref target="RFC8946" format="default">diversion PASSporTs</xref> to sign for its target set.
          </t>
        </section>
      </section>
    </section>
    <section anchor="certs" numbered="true" toc="default">
      <name>Certificates and Messaging</name>
      <t>
	  "<xref target="RFC8226" format="title"/>" <xref target="RFC8226" format="default"/>  defines a way to issue certificates that sign PASSporTs, which attest through their TNAuthList a Service Provider Code (SPC) and/or a set of one or more telephone numbers. This specification proposes that the semantics of these certificates should suffice for signing for messages from a telephone number without further modification.
      </t>
      <t>
	Note that the certificate referenced by the "x5u" of a PASSporT can change over time due to certificate expiry/rollover; in particular, the use of short-lived certificates can entail rollover on a daily basis or even more frequently. Thus, any store-and-forward messaging system relying on PASSporTs must take into account the possibility that the certificate that signed the PASSporT, though valid at the time the PASSporT was generated, could expire before a user reads the message. This might require:</t>
<ul>
	<li>storing some indicator of the validity of the signature and certificate at the time the message was received, or</li>
	<li>securely storing the certificate along with the PASSporT</li></ul>
	<t>so that the "iat" claim can be compared with the expiry freshness window of the certificate prior to validation.</t>



      <t>
	  As the "orig" and "dest" claims of PASSporTs may contain URIs without telephone numbers, the STIR for messaging mechanism contained in this specification is not inherently restricted to the use of telephone numbers. This specification offers no guidance on appropriate certification authorities for designing "orig" values that do not contain telephone numbers.

      </t>
    </section>


    
    <section anchor="IANA" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section numbered="true" toc="default">
        <name>JSON Web Token Claims Registration</name>
        <t>IANA has added one new claim to the "JSON Web Token Claims" registry that was defined in <xref target="RFC7519" format="default"/>.</t>
<dl>
<dt>Claim Name:</dt><dd>msgi</dd>
<dt>Claim Description:</dt><dd>Message Integrity Information</dd>
<dt>Change Controller:</dt><dd>IETF</dd>
<dt>Specification Document(s):</dt><dd>RFC 9475</dd>
</dl>
      </section>
      <section numbered="true" toc="default">
        <name>PASSporT Type Registration</name>
        <t>This specification defines one new PASSporT type for the "Personal Assertion Token (PASSporT) Extensions" registry defined in <xref target="RFC8225" format="default"/>.</t>
<dl>
<dt>ppt value:</dt><dd>msg</dd> 
<dt>Reference:</dt><dd><xref target="message" format="default"/> of RFC 9475</dd>
</dl>
      </section>
    </section>
    <section anchor="Privacy" numbered="true" toc="default">
      <name>Privacy Considerations</name>
      <t>
	  Signing messages or message sessions with STIR has little direct bearing on the privacy of messaging for SIP as described in <xref target="RFC3428" format="default"/> or <xref target="RFC4975" format="default"/>. An authentication service signing a MESSAGE method may compute the "msgi" hash over the message contents; if the message is in cleartext, that will reveal its contents to the authentication service, which might not otherwise be in the call path. 
      </t>
      <t>
	  The implications for anonymity of STIR are discussed in <xref target="RFC8224" format="default"/>, and those considerations would apply equally here for anonymous messaging. Creating an "msg" PASSporT does not add any additional privacy
          protections to the original message content.
      </t>
    </section>
    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
	  This specification inherits the security considerations of <xref target="RFC8224" format="default"/>. The carriage of messages within SIP per <xref target="message" format="default"/> has a number of security and privacy implications as documented in <xref target="RFC3428" format="default"/>, which are expanded in <xref target="RFC8591" format="default"/>; these considerations apply here as well. The guidance about store-and-forward messaging and replay protection in <xref target="message" format="default"/> should also be recognized by implementers.
      </t>
      <t>
	  Note that a variety of protocols that are not SIP, both those integrated into the telephone network and those based on over-the-top applications, are responsible for most of the messaging that is sent to and from telephone numbers today. Introducing this capability for SIP-based messaging will help to mitigate spoofing and nuisance messaging for SIP-based platforms only. 
      </t>
    </section>
  </middle>
  <back>

<displayreference target="I-D.ietf-stir-rfc4916-update" to="CONNECT-ID-STIR"/>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3261.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8224.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8225.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8226.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3428.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3862.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6234.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4648.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7340.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4975.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8591.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4103.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7519.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8862.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7489.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8876.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8816.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8946.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5194.xml"/>

<!-- [I-D.peterson-stir-rfc4916-update]	Replaced by [I-D.ietf-stir-rfc4916-update] IESG state I-D Exists -->
	
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/reference.I-D.ietf-stir-rfc4916-update.xml"/>

        <reference anchor="SHA2" target="http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf">
          <front>
            <title>Secure Hash Standard (SHS)</title>
            <author>
              <organization>
           National Institute of Standards and Technology (NIST)
              </organization>
            </author>
            <date year="2008"/>
          </front>
	  <seriesInfo name="FIPS PUB" value="180-3"/>
        </reference>

        <reference anchor="RCC.07" target="https://www.gsma.com/futurenetworks/wp-content/uploads/2019/09/RCC.07-v9.0.pdf">
          <front>
            <title>Rich Communication Suite 8.0 Advanced Communications Services and Client Specification</title>
            <author>
              <organization>GSMA 
              </organization>
            </author>
            <date month="May" year="2018"/>
          </front>
	  <refcontent>Version 9.0</refcontent>
        </reference>

        <reference anchor="RCC.15" target="https://www.gsma.com/newsroom/wp-content/uploads//RCC.15-v7.0.pdf">
          <front>
            <title>IMS Device Configuration and Supporting Services</title>
            <author>
              <organization>GSMA</organization>
            </author>
            <date month="October" year="2019"/>
          </front>
	  <refcontent>Version 7.0</refcontent>
        </reference>

        <reference anchor="SMPP" target="https://smpp.org/SMPP_v5.pdf">
          <front>
            <title>Short Message Peer-to-Peer Protocol Specification</title>
            <author>
              <organization>SMS Forum</organization>
            </author>
            <date month="February" year="2003"/>
          </front>
	  <refcontent>Version 5.0</refcontent>
        </reference>
      </references>
    </references>

    <section anchor="Acknowledgments" numbered="false">
      <name>Acknowledgments</name>
      <t>We would like to thank <contact fullname="Christer Holmberg"/>,
      <contact fullname="Brian Rosen"/>, <contact fullname="Ben Campbell"/>,
      <contact fullname="Russ Housley"/>, and <contact fullname="Alex
      Bobotek"/> for their contributions to this specification.</t>
    </section>
</back>
</rfc>
