ietf-corpus

rfc-8591

SIP-Based Messaging with S/MIME

B. Campbell, R. Housley
date2019-04 streamIETF wgnon working group statusPROPOSED STANDARD pages39 canonicalhttps://www.rfc-editor.org/rfc/rfc8591 doi10.17487/RFC8591
Mobile messaging applications used with the Session Initiation Protocol (SIP) commonly use some combination of the SIP MESSAGE method and the Message Session Relay Protocol (MSRP). While these provide mechanisms for hop-by-hop security, neither natively provides end-to-end protection. This document offers guidance on how to provide end-to-end authentication, integrity protection, and confidentiality using the Secure/Multipurpose Internet Mail Extensions (S/MIME). It updates and provides clarifications for RFCs 3261, 3428, and 4975.

updates

Extracted elements (34)

design-rationale §8.2

MSRP's streaming mode (sending chunks before knowing total message length) is incompatible with S/MIME because S/MIME must operate on the entire message. The Byte-Range header with total length must be present in every chunk to enable reassembly before S/MIME processing.

security

design-rationale §4.3

RFC 3261 Section 23.2 required sign-then-encrypt order (SignedData inside EnvelopedData), but this document reverses it to sign-first-then-encrypt (SignedData inside AuthEnvelopedData) for SIP MESSAGE, because authenticated encryption provides authentication without the SignedData layer and ciphertext modification in EnvelopedData can otherwise go undetected.

sip, security, crypto

design-rationale §7.2

SIP OPTIONS-based capability discovery for S/MIME is unreliable because SIP proxies may fork requests and return only the 'best' response, meaning the sender may learn capabilities of only one of the recipient's multiple devices. Out-of-band methods are recommended instead.

sip

design-rationale §4.1

The application/pkcs7-mime format is RECOMMENDED over multipart/signed because email experience shows multipart/signed bodies are at greater risk of 'helpful' tampering by intermediaries (e.g., insertion of IMDN requests), which causes signature validation failures. It is also more compact, important for SIP MESSAGE's 1300-octet size limit.

sip, security, crypto

design-rationale §7.1

The SIP MESSAGE method is limited to 1300 octets to avoid UDP fragmentation. Certificates embedded in SignedData can push messages past this limit; omitting the certificate when the recipient is known to have it is permitted as a size optimization.

sip, security

interoperability-note §8.3

For MSRP, a sender MAY treat a peer advertising '*' in accept-types as potentially supporting S/MIME; if the peer returns MSRP 415, the sender should treat it as not supporting S/MIME for the session duration.

sip, security

interoperability-note §9.2

Intermediaries that insert IMDN notification requests or other metadata into end-to-end signed messages will cause signature validation to fail. Systems using S/MIME with IMDN must account for this incompatibility.

sip, security

interoperability-note §4.3

Recipients SHOULD accept signed-and-encrypted messages in either order (SignedData inside AuthEnvelopedData, or AuthEnvelopedData inside SignedData) for backwards compatibility, even though the MUST order is sign-first.

sip, security, crypto

interoperability-note §9.1

UAs that support both S/MIME and CPIM SHOULD be able to validate signatures and decrypt enveloped data whether operations are applied to the entire CPIM body or only the CPIM payload, since some messaging networks require inspection of CPIM metadata.

sip, security

normative-requirement §7.1 SHOULD

A SignedData message sent in a SIP MESSAGE request SHOULD contain the certificate but MAY omit it if the sender has reason to believe the recipient already has it or has another access method. This updates RFC 3261 Section 23.2.

sip, security, pkix

normative-requirement §8.3 MUST

A UA supporting this specification MUST explicitly include appropriate S/MIME media type(s) in the accept-types attribute of any SDP offer or answer proposing MSRP.

sip, security

normative-requirement §7.3 MUST

A UAC that receives a SIP MESSAGE request with an unsupported media type MUST return a 415 (Unsupported Media Type) response. This updates RFC 3428 Section 11.3.

sip

normative-requirement §6 MUST

At a minimum, a UA that supports S/MIME MUST be able to validate a signed message. UAs that wish to indicate support for validating clear-signed message signatures MUST also indicate support for application/pkcs7-signature.

sip, security

normative-requirement §12 MUST

Clients MUST ensure that a text/html content type in an S/MIME body is a complete HTML document, and MUST treat each encrypted or signed piece of a MIME message as being from different origins. This mitigates the EFAIL attack.

security

normative-requirement §8.4 MUST

Endpoints MUST NOT use MSRP URIs to identify certificates or insert them into certificate Subject Alternative Name fields; SIP AoRs MUST be used instead.

sip, security, pkix

normative-requirement §4.2 MUST

Sending and receiving UAs MUST support AES-128-GCM for content encryption and MUST support AES-128-WRAP for key encryption. If key agreement is supported, UAs MUST support ECDH with NIST P-256 and ANSI-X9.63-KDF/SHA-256, and SHOULD support ECDH with X25519.

security, crypto

normative-requirement §4.1 MUST

Sending and receiving UAs MUST support the SHA-256 message digest algorithm and MUST support ECDSA with NIST P-256 and SHA-256 for signing. UAs SHOULD support EdDSA with Ed25519.

security, crypto

normative-requirement §4.4.1 MUST

SIP URI subject alternative names in certificates MUST be encoded using the uniformResourceIdentifier CHOICE of the GeneralName type as described in RFC 5280 Section 4.2.1.6.

sip, pkix, security

normative-requirement §8.1 MUST

The sender MUST apply any S/MIME operations to the whole MSRP message prior to breaking it into chunks; the receiver must reassemble chunks before decrypting or validating.

security

normative-requirement §7.3 SHOULD

The UAS SHOULD return a SIP 493 (Undecipherable) response if it immediately attempts decryption and finds the message was encrypted to the wrong certificate; it MAY return a 200-class response if decryption is deferred. This updates RFC 3261.

sip, security

normative-requirement §4.1 MUST

When generating a signed message, sending UAs SHOULD follow the conventions in RFC 8551 for application/pkcs7-mime with smime-type=signed-data; when validating, receiving UAs MUST follow those conventions.

sip, security, crypto

normative-requirement §4.2 MUST

When generating an encrypted message, sending UAs MUST follow RFC 8551 conventions for application/pkcs7-mime with smime-type=auth-enveloped-data; receiving UAs MUST follow the same conventions when decrypting.

security, crypto

normative-requirement §8.2 MUST

When sending an S/MIME-formatted MSRP message, the sender MUST include the Byte-Range header field for every chunk including the first, and the Byte-Range header field MUST include the total message length.

security

normative-requirement §4.3 MUST

When sending signed and encrypted user content in a SIP MESSAGE request, sending UAs MUST sign the message first and then encrypt it (SignedData inside AuthEnvelopedData). Recipients SHOULD accept messages signed and encrypted in either order.

sip, security, crypto

normative-requirement §4.4.2 MUST

When validating a certificate, receiving UAs MUST support ECDSA with NIST P-256 and SHA-256.

security, crypto, pkix

protocol-element §8.1

MSRP chunking: S/MIME operations must be applied to the entire message before chunking. Intermediaries may reorder or resize chunks; scanning for MSRP end-lines occurs per chunk after S/MIME operations are applied.

security

protocol-element §4.2

S/MIME encrypted messages use the application/pkcs7-mime media type with smime-type=auth-enveloped-data, replacing the older EnvelopedData type to provide authenticated encryption without a separate SignedData layer.

sip, security, crypto

protocol-element §4.1

S/MIME signed messages use the application/pkcs7-mime media type with smime-type=signed-data. The application/pkcs7-mime format is preferred over multipart/signed because it is more compact and less susceptible to intermediary tampering.

sip, security, crypto

protocol-element §6

UAs advertise S/MIME support by indicating capability to receive application/pkcs7-mime in SIP Accept headers or MSRP SDP accept-types. A UA can advertise all smime-types with no parameters, or specific smime-types with appropriate parameters.

sip, security

security-consideration §12

Certificate validation must match the certificate to the SIP AoR the UAS relies upon for display or filtering, typically the From header field or P-Asserted-Identity, not just any header field. Online revocation checks should be performed as mobile messaging is typically an online application.

security, pkix, sip

security-consideration §12

Modification of ciphertext in EnvelopedData can go undetected without authentication; this is a key reason for the transition to AuthEnvelopedData, which provides authenticated encryption without requiring a separate SignedData wrapper.

security, crypto

security-consideration §12

MSRP chunk reassembly is vulnerable to denial-of-service via large Byte-Range header values. Implementations must sanity-check these values before allocating memory for reassembly, as described in RFC 4975 Section 14.5.

security

security-consideration §12

S/MIME does not normally protect SIP or MSRP headers, only the body. SIP/MSRP/CPIM headers attached by intermediaries (e.g., RCS application servers) may leak metadata. Implementors should assess whether inserted metadata creates privacy leaks.

sip, security, privacy

security-consideration §12

The secure notification use case (e.g., 2FA codes, financial alerts) is vulnerable to phishing, eavesdropping, and impersonation. End-to-end protection alone is insufficient unless recipients are trained to reject unsigned messages that appear to be from trusted senders.

security