RFC 8217

Clarifications for When to Use the name-addr Production in SIP Messages

πŸ“… published August 2017, from ietf

Clarifications for When to Use the name-addr Production in SIP Messages πŸŽ€

Okay bestie, this is RFC 8217, and it's a Standards Track doc by Robert Sparks at Oracle, dated August 2017 πŸ’… It's updating RFCs 3261, 3325, 3515, 3892, 4508, 5002, 5318, 5360, and 5502. There's no Obsoletes line in the header, so nothing gets replaced. The ISSN is 2070-1721 ✨


Abstract

okay so RFC 3261 put limits on a bunch of SIP header fields that have a "name-addr / addr-spec" choice. The rule is that you use name-addr when certain characters show up 🫠 The problem is it wrote that rule as prose copied into each header field, and at least one header field got missed πŸ’€ Extension headers also never got the rule copied in.

This document makes the rule general πŸ¦‹ It says the constraint covers every SIP header field where you get to choose between name-addr and addr-spec. It also updates the extension RFCs that use the choice (RFCs 3325, 3515, 3892, 4508, 5002, 5318, 5360, and 5502) so the rule clearly applies to them too 🫢

Status of This Memo

This is an Internet Standards Track document. ✨

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

Info about this doc's current status, any errata, and how to send feedback is at http://www.rfc-editor.org/info/rfc8217.

Copyright (c) 2017 IETF Trust and the persons identified as the
document authors.  All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents

(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document.  Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document.  Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.

Table of Contents 🌸

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   3
3.  Updates to RFC 3261 . . . . . . . . . . . . . . . . . . . . .   4
4.  Updates to RFCs Defining SIP Extension Header Fields  . . . .   4
5.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
6.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
7.  Normative References  . . . . . . . . . . . . . . . . . . . .   5
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .   6
Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   6

1. Introduction ✨

okay so [RFC3261] lets a bunch of header fields hold URIs in two forms: the bare one (addr-spec) and one with a name plus the URI (name-addr) πŸŽ€ Here's the slice of ABNF from [RFC5234] that [RFC3261] uses, showing the "From" header field:

  From        =  ( "From" / "f" ) HCOLON from-spec
  from-spec   =  ( name-addr / addr-spec )
                 *( SEMI from-param )
  name-addr      =  [ display-name ] LAQUOT addr-spec RAQUOT
  addr-spec      =  SIP-URI / SIPS-URI / absoluteURI

Section 20.20 of [RFC3261] is the part about "From", and it limits the name-addr choice like this:

   Even if the "display-name" is empty, the "name-addr" form
   MUST be used if the "addr-spec" contains a comma, question
   mark, or semicolon.

Section 20.39 of [RFC3261] covers "To", and it has no limit like that πŸ™ˆ

The same idea shows up in a slightly different way in the intro to Section 20 of [RFC3261]:

  The Contact, From, and To header fields contain a URI.  If the URI
  contains a comma, question mark or semicolon, the URI MUST be
  enclosed in angle brackets (< and >).

The catch is you could read that as only applying to Contact, From, and To. So every other header field that has the name-addr or addr-spec choice needs the rule spelled out again in its own prose. Rude 😀

When extension headers got standardized, the specs often forgot the rule. There are a bunch of errata fixing that πŸ’… And even when the rule was added, the name-addr requirement wasn't stated consistently.

This memo updates SIP and its extensions to make it clear that the name-addr rule applies anywhere the grammar lets you pick between the name-addr and addr-spec production rules for SIP header fields. Main character energy πŸ‘‘

Heads up 🚨 If you build a message without following the rule, it's still syntactically valid. It just'll very likely get interpreted differently. The characters after the comma, question mark, or semicolon will usually get read as header field parameters or extra header field values, as covered in Section 7.3.1 of [RFC3261]. (The one exception is the weird edge case of a URL like sip:10.0.0.1,@10.0.0.0, where the comma can be parsed through the 'user' production πŸ™ƒ)

2. Terminology πŸ¦‹

The key words are:

"MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL"

They're to be read as described in BCP 14 [RFC2119] [RFC8174], but only when they show up in all capitals, exactly like that. Lowercase is just regular words, bestie πŸ’œ

3. Updates to RFC 3261 πŸ’–

This is the text from the intro to Section 20 of [RFC3261] that gets swapped out:

  The Contact, From, and To header fields contain a URI.  If the URI
  contains a comma, question mark or semicolon, the URI MUST be
  enclosed in angle brackets (< and >).  Any URI parameters are
  contained within these brackets.  If the URI is not enclosed in
  angle brackets, any semicolon-delimited parameters are
  header-parameters, not URI parameters.

It gets replaced with this, and I'm obsessed with how clean it is 😭

  When constructing the value of any SIP header field whose grammar
  allows choosing between name-addr and addr-spec, such as those
  that use the form '(name-addr / addr-spec)', the addr-spec form
  MUST NOT be used if its value would contain a comma, semicolon,
  or question mark.

  When a URI appears in such a header field, any URI parameters MUST
  be contained within angle brackets (< and >).  If the URI is not
  enclosed in angle brackets, any semicolon-delimited parameters are
  header-parameters, not URI parameters.

  The header fields defined in this specification that allow this
  choice are "To", "From", "Contact", and "Reply-To".

4. Updates to RFCs Defining SIP Extension Header Fields 🌈

These Standards Track RFCs get updated: [RFC3515], [RFC3892], [RFC4508], and [RFC5360] ✨

These Informational RFCs get updated too: [RFC3325], [RFC5002], [RFC5318], and [RFC5502] 🫢

Each of them gets this added text:

   This RFC contains the definition of one or more SIP header fields
   that allow choosing between addr-spec and name-addr when
   constructing header field values. As specified in RFC 8217,
   the "addr-spec" form MUST NOT be used if its value would contain
   a comma, semicolon, or question mark.

Their status doesn't change. The Informational ones stay Informational, periodt πŸ’…

5. IANA Considerations 🌸

This document doesn't need any IANA actions. Nothing to register, nothing to fill out πŸ“

6. Security Considerations πŸ’€

Okay, this part is serious bestie. The updates here just clarify a constraint on the grammar used to produce SIP messages. This memo adds no new security considerations. One existing one is worth saying again, though: messages built without honoring the constraint will very likely get misinterpreted by the receiving element. That is a real problem, not a vibe 😱

7. Normative References πŸ“š

[RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
           Requirement Levels", BCP 14, RFC 2119,
           DOI 10.17487/RFC2119, March 1997,
           <http://www.rfc-editor.org/info/rfc2119>.

[RFC3261]  Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston,
           A., Peterson, J., Sparks, R., Handley, M., and E.
           Schooler, "SIP: Session Initiation Protocol", RFC 3261,
           DOI 10.17487/RFC3261, June 2002,
           <http://www.rfc-editor.org/info/rfc3261>.

[RFC3325]  Jennings, C., Peterson, J., and M. Watson, "Private
           Extensions to the Session Initiation Protocol (SIP) for
           Asserted Identity within Trusted Networks", RFC 3325,
           DOI 10.17487/RFC3325, November 2002,
           <http://www.rfc-editor.org/info/rfc3325>.

[RFC3515]  Sparks, R., "The Session Initiation Protocol (SIP) Refer
           Method", RFC 3515, DOI 10.17487/RFC3515, April 2003,
           <http://www.rfc-editor.org/info/rfc3515>.

[RFC3892]  Sparks, R., "The Session Initiation Protocol (SIP)
           Referred-By Mechanism", RFC 3892, DOI 10.17487/RFC3892,
           September 2004, <http://www.rfc-editor.org/info/rfc3892>.

[RFC4508]  Levin, O. and A. Johnston, "Conveying Feature Tags with
           the Session Initiation Protocol (SIP) REFER Method",
           RFC 4508, DOI 10.17487/RFC4508, May 2006,
           <http://www.rfc-editor.org/info/rfc4508>.

[RFC5002]  Camarillo, G. and G. Blanco, "The Session Initiation
           Protocol (SIP) P-Profile-Key Private Header (P-Header)",
           RFC 5002, DOI 10.17487/RFC5002, August 2007,
           <http://www.rfc-editor.org/info/rfc5002>.

[RFC5234]  Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
           Specifications: ABNF", STD 68, RFC 5234,
           DOI 10.17487/RFC5234, January 2008,
           <http://www.rfc-editor.org/info/rfc5234>.

[RFC5318]  Hautakorpi, J. and G. Camarillo, "The Session Initiation
           Protocol (SIP) P-Refused-URI-List Private-Header
           (P-Header)", RFC 5318, DOI 10.17487/RFC5318, December
           2008, <http://www.rfc-editor.org/info/rfc5318>.

[RFC5360]  Rosenberg, J., Camarillo, G., Ed., and D. Willis, "A
           Framework for Consent-Based Communications in the Session
           Initiation Protocol (SIP)", RFC 5360,
           DOI 10.17487/RFC5360, October 2008,
           <http://www.rfc-editor.org/info/rfc5360>.

[RFC5502]  van Elburg, J., "The SIP P-Served-User Private-Header
           (P-Header) for the 3GPP IP Multimedia (IM) Core Network
           (CN) Subsystem", RFC 5502, DOI 10.17487/RFC5502, April
           2009, <http://www.rfc-editor.org/info/rfc5502>.

[RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
           2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
           May 2017, <http://www.rfc-editor.org/info/rfc8174>.

Acknowledgments 🫢

Brett Tate spotted this issue across several extension documents, filed a bunch of the errata, and pushed the discussion that led to this memo. Thank you, Brett πŸ‘‘ Substantive comments that shaped this text came from Paul Kyzivat, Gonzalo Camarillo, Dale Worley, and Yehoshua Gev πŸ’œ

Author's Address πŸ¦‹

Robert Sparks
Oracle

Email: rjsparks@nostrum.com
πŸ“¦ where this page comes from