Internet Engineering Task Force (IETF) R. Sparks Request for Comments: 8217 Oracle Updates: 3261, 3325, 3515, 3892, 4508, August 2017 5002, 5318, 5360, 5502 Category: Standards Track ISSN: 2070-1721
Clarifications for When to Use the name-addr Production in SIP Messages
RFC 3261 constrained several SIP header fields whose grammar contains the "name-addr / addr-spec" alternative to use name-addr when certain characters appear. Unfortunately, it expressed the constraints with prose copied into each header field definition, and at least one header field was missed. Further, the constraint has not been copied into documents defining extension headers whose grammar contains the alternative.
This document updates RFC 3261 to state the constraint generically and clarifies that the constraint applies to all SIP header fields where there is a choice between using name-addr or addr-spec. It also updates the RFCs that define extension SIP header fields using the alternative to clarify that the constraint applies (RFCs 3325, 3515, 3892, 4508, 5002, 5318, 5360, and 5502).
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.
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.
[RFC3261] defines several header fields that contain URIs to allow both a form that contains the bare URI (addr-spec) and one that provides a name and the URI (name-addr). This subset, taken from the ABNF [RFC5234] specified in [RFC3261], shows the relevant part of the definition of the syntax of the "From" header field:
The prose in Section 20.20 of [RFC3261], which discusses the "From" header field, constrains how the production may be used by saying:
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.
Sparks Standards Track [Page 2]
RFC 8217 name-addr Clarifications August 2017
Section 20.39 of [RFC3261], which discusses the "To" header field, contains no such constraining text.
This constraint is specified slightly differently, but with the same intent, in the introduction 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 >).
Unfortunately, this can be read to only apply to the Contact, From, and To header fields, making it necessary to provide the constraint explicitly in the prose discussing any other header field using the name-addr or addr-spec alternative.
As extension header fields were standardized, the specifications sometimes failed to include the constraint. Many errata have been entered to correct this omission. When the constraint has been included, the requirement to use the name-addr form has not been consistently stated.
This memo updates the specifications of SIP and its extensions to clarify that the constraint to use the name-addr form applies anywhere there is a choice between the name-addr and addr-spec production rules in the grammar for SIP header fields.
It is important to note that a message formed without honoring the constraint will still be syntactically valid, but it would very likely be interpreted differently. The characters after the comma, question mark, or semicolon will, in most cases, be interpreted as header field parameters or additional header field values as discussed in Section 7.3.1 of [RFC3261]. (An exception is the degenerate case of a URL like sip:10.0.0.1,@10.0.0.0 where it is possible to parse the comma via the 'user' production).
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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
This text from introduction 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 >). 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.
is replaced with:
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
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.
The status of these RFCs remains unchanged. In particular the status of the Informational RFCs remains Informational.
The updates specified in this memo clarify a constraint on the grammar for producing SIP messages. It introduces no new security considerations. One pre-existing consideration is worth reiterating: messages produced without honoring the constraint will very likely be misinterpreted by the receiving element.
Brett Tate identified this issue in several extension documents, submitted several corresponding errata, and drove the discussion that led to this memo. Substantive comments leading to this text were provided by Paul Kyzivat, Gonzalo Camarillo, Dale Worley, and Yehoshua Gev.