At a high level, [
RFC 8225] 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.
When it comes to protecting message contents, broadly, there are a few ways that the PASSporT mechanism of STIR could apply to messaging:
-
in sessionless scenarios, a PASSporT could be generated on a per-message basis with its own built-in message security (see Section 3.2).
In the first case, SIP negotiates a session in which the media will be text messages or MIME content, as, for example, with the [
RFC 4975]. This usage of STIR would deviate little from [
RFC 8224]. 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 [
RCC.07]. Note that, if TLS is used to secure MSRP (per RCS [
RCC.15]), fingerprints of those TLS keys could be secured via the "mky" claim of PASSporT using the framework described in [
RFC 8862]. Similar practices would apply to sessions that negotiate real-time text over RTP ([
RFC 4103], [
RFC 5194]); 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.
Current usage of [
RFC 8224] 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 [
CONNECT-ID-STIR], but the specification of PASSporT-signed session conferencing is outside the scope of this document.
Also note that the assurance offered by [
RFC 8862] 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.
In the second case described in
Section 3, SIP also has a method for sending messages in the body of a SIP request: the [
RFC 3428]. 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, [
RFC 8591] has been proposed as a means of providing integrity for MESSAGE (and some MSRP cases as well). The use of [
RFC 3862] 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 [
RFC 8226]) 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.
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) [
RFC 7519] claim "msgi", which provides a digest over a MIME body that contains a text or multimedia message. Authentication services
MUST NOT include "msgi" elements in PASSporT types other than "msg", but "msgi" is
OPTIONAL in "msg" PASSporTs, as integrity for messages may be provided by some other service (e.g. [
RFC 8591]). Verification services
MUST ignore the presence of "msgi" in non-"msg" PASSporT types.
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
MUST 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 [
RFC 6234] defined by the US National Institute of Standards and Technology (NIST). [
SHA2] implementations
MAY support additional recommended hash algorithms in the
"COSE Algorithms" registry; that is, the hash algorithm has "Yes" in the "Recommended" column of the IANA registry. Hash algorithm identifiers
MUST use only lowercase letters, and they
MUST NOT contain hyphen characters. The character following the algorithm string
MUST be a hyphen character ("-" or ASCII character 45).
The subsequent characters in the claim value are the base64-encoded [
RFC 4648] 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 [
RFC 3428], 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:
"msgi" : "sha256-H8BRh8j48O9oYatfu5AZzq6A9RINQZngK7T62em8MUt1FLm52t+eX6xO"
Per [
RFC 8224], 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.
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
Section 9.1 of
RFC 8591.
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 [
RFC 8224] 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.
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 [
RFC 8224], with the addition of the "msgi" claim defined in
Section 3.2.
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 "[
Domain-based Message Authentication, Reporting, and Conformance (DMARC)]" [
RFC 7489]. The interaction of these mechanisms with STIR certificates and/or PASSporTs would require further study and is outside the scope of this document.
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 [
RFC 8816] 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 [
SMPP] systems cannot be upgraded.
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 [
RFC 8946] to sign for its target set.